Skip to content

Commit 1fb9af2

Browse files
committed
Include CXXFLAGS in build command for target.
1 parent 7c09417 commit 1fb9af2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

compile.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ CXXFLAGS += -std=c++11
2323
# Define compiler/linker target if cross-compiling
2424
ifdef CROSS_COMPILE
2525
FLAGS += --target=$(MACHINE)
26-
LDFLAGS += --target=$(MACHINE)
2726
endif
2827

2928
# Architecture-independent flags
@@ -39,10 +38,8 @@ ifdef ARCH_LIN
3938
endif
4039
ifdef ARCH_MAC
4140
CXXFLAGS += -stdlib=libc++
42-
LDFLAGS += -stdlib=libc++
4341
MAC_SDK_FLAGS := -mmacosx-version-min=10.9
4442
FLAGS += $(MAC_SDK_FLAGS)
45-
LDFLAGS += $(MAC_SDK_FLAGS)
4643
endif
4744
ifdef ARCH_WIN
4845
FLAGS += -D_USE_MATH_DEFINES
@@ -69,7 +66,7 @@ DEPENDENCIES := $(patsubst %, build/%.d, $(SOURCES))
6966
# Final targets
7067

7168
$(TARGET): $(OBJECTS)
72-
$(CXX) -o $@ $^ $(LDFLAGS)
69+
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
7370

7471
-include $(DEPENDENCIES)
7572

dep.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ DEP_FLAGS += -fPIC
1313
# Define compiler/linker target if cross-compiling
1414
ifdef CROSS_COMPILE
1515
DEP_FLAGS += --target=$(MACHINE)
16-
DEP_LDFLAGS += --target=$(MACHINE)
1716
endif
1817

1918
ifdef ARCH_X64
@@ -25,12 +24,14 @@ endif
2524

2625
ifdef ARCH_MAC
2726
DEP_MAC_SDK_FLAGS := -mmacosx-version-min=10.9
28-
DEP_FLAGS += $(DEP_MAC_SDK_FLAGS) -stdlib=libc++
29-
DEP_LDFLAGS += $(DEP_MAC_SDK_FLAGS) -stdlib=libc++
27+
DEP_FLAGS += $(DEP_MAC_SDK_FLAGS)
28+
DEP_CXXFLAGS += -stdlib=libc++
29+
DEP_LDFLAGS += -stdlib=libc++
3030
endif
3131

3232
DEP_CFLAGS += $(DEP_FLAGS)
3333
DEP_CXXFLAGS += $(DEP_FLAGS)
34+
DEP_LDFLAGS += $(DEP_FLAGS)
3435

3536
# Commands
3637
WGET := wget -c

0 commit comments

Comments
 (0)