From 11ba38764d19f1f5eb5a35571eb3bf4c8f4cb57e Mon Sep 17 00:00:00 2001 From: merlokk Date: Thu, 19 Oct 2017 14:11:51 +0300 Subject: [PATCH] fix compiler warning for windows --- client/Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/client/Makefile b/client/Makefile index 3a96e9e9..ff0a9a19 100644 --- a/client/Makefile +++ b/client/Makefile @@ -4,6 +4,13 @@ # the license. #----------------------------------------------------------------------------- +# OS detection +ifeq ($(OS),Windows_NT) + detected_OS := Windows +else + detected_OS := $(shell sh -c 'uname -s 2>/dev/null || echo not') +endif + CC = gcc CXX = g++ LD = g++ @@ -49,7 +56,11 @@ ifeq ($(QTINCLUDES), ) MOC = $(shell pkg-config --variable=moc_location QtCore) UIC = $(shell pkg-config --variable=uic_location QtCore) else - CXXFLAGS += -std=c++11 -fPIC + ifeq ($(detected_OS),Windows) + CXXFLAGS += -std=c++11 + else + CXXFLAGS += -std=c++11 -fPIC + endif endif ifeq ($(QTINCLUDES), ) # if both pkg-config commands failed, search in common places @@ -59,7 +70,11 @@ ifeq ($(QTINCLUDES), ) ifneq ($(wildcard $(QTDIR)/include/QtWidgets),) QTINCLUDES += -I$(QTDIR)/include/QtWidgets QTLDLIBS = -L$(QTDIR)/lib -lQt5Widgets -lQt5Gui -lQt5Core - CXXFLAGS += -std=c++11 -fPIC + ifeq ($(detected_OS),Windows) + CXXFLAGS += -std=c++11 + else + CXXFLAGS += -std=c++11 -fPIC + endif endif MOC = $(QTDIR)/bin/moc UIC = $(QTDIR)/bin/uic