Don't use -fPIC on static builds.

This commit is contained in:
Pietro Gagliardi 2016-05-29 22:02:49 -04:00
parent 2ed29a7fa0
commit 708d8f38e9
1 changed files with 6 additions and 6 deletions

View File

@ -1,11 +1,8 @@
# 16 october 2015 # 16 october 2015
# TODO the loader looks for the soname, not the base name, which is frustrating
# Global flags. # Global flags.
CFLAGS += \ CFLAGS += \
-fPIC \
-Wall -Wextra -pedantic \ -Wall -Wextra -pedantic \
-Wno-unused-parameter \ -Wno-unused-parameter \
-Wno-switch \ -Wno-switch \
@ -14,14 +11,17 @@ CFLAGS += \
# C++11 is needed due to stupid rules involving commas at the end of enum lists that C++03 stupidly didn't follow # C++11 is needed due to stupid rules involving commas at the end of enum lists that C++03 stupidly didn't follow
# This means sorry, no GCC 2 for Haiku builds :( # This means sorry, no GCC 2 for Haiku builds :(
CXXFLAGS += \ CXXFLAGS += \
-fPIC \
-Wall -Wextra -pedantic \ -Wall -Wextra -pedantic \
-Wno-unused-parameter \ -Wno-unused-parameter \
-Wno-switch \ -Wno-switch \
--std=c++11 --std=c++11
LDFLAGS += \ # -fPIC shouldn't be used with static builds (see https://github.com/andlabs/libui/issues/72#issuecomment-222395547)
-fPIC ifeq (,$(STATIC))
CFLAGS += -fPIC
CXXFLAGS += -fPIC
LDFLAGS += -fPIC
endif
ifneq ($(RELEASE),1) ifneq ($(RELEASE),1)
CFLAGS += -g CFLAGS += -g