Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de33a57

Browse files
committed
Rename make variable CXXFLAGS -> EXTRA_FLAGS
Since CXXFLAGS is supposed to hold user-provided flags, the build should not break when a user manually overrides these.
1 parent f1af639 commit de33a57

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Use C++11
2-
CXXFLAGS += -std=c++11
1+
# Use C++11, dont warn on long-to-float conversion
2+
CXXFLAGS += -std=c++11 -Wno-conversion
33

44
# Default to using system's default version of python
55
PYTHON_BIN ?= python
66
PYTHON_CONFIG := $(PYTHON_BIN)-config
77
PYTHON_INCLUDE ?= $(shell $(PYTHON_CONFIG) --includes)
8-
CXXFLAGS += $(PYTHON_INCLUDE)
8+
EXTRA_FLAGS := $(PYTHON_INCLUDE)
99
LDFLAGS += $(shell $(PYTHON_CONFIG) --libs)
1010

1111
# Either finds numpy or set -DWITHOUT_NUMPY
12-
CXXFLAGS += $(shell $(PYTHON_BIN) $(CURDIR)/numpy_flags.py)
12+
EXTRA_FLAGS += $(shell $(PYTHON_BIN) $(CURDIR)/numpy_flags.py)
1313
WITHOUT_NUMPY := $(findstring $(CXXFLAGS), WITHOUT_NUMPY)
1414

1515
# Examples requiring numpy support to compile
@@ -28,7 +28,7 @@ examples: $(EXAMPLE_TARGETS)
2828
# Assume every *.cpp file is a separate example
2929
$(EXAMPLE_TARGETS): examples/build/%: examples/%.cpp
3030
mkdir -p examples/build
31-
$(CXX) -o $@ $< $(CXXFLAGS) $(LDFLAGS)
31+
$(CXX) -o $@ $< $(EXTRA_FLAGS) $(CXXFLAGS) $(LDFLAGS)
3232

3333
clean:
3434
rm -f ${EXAMPLE_TARGETS}

0 commit comments

Comments
 (0)