mapbox / variant

C++11/C++14 Variant
BSD 3-Clause "New" or "Revised" License
371 stars 100 forks source link

Using GCC/G++ on Darwin #108

Closed artemp closed 8 years ago

artemp commented 8 years ago

Currently it's not possible to build targets on OS X using GCC due to extra flags: https://github.com/mapbox/variant/blob/master/Makefile#L14-L18

CXX=/usr/local/gcc-5.2.0/bin/g++-5.2.0 make test bench sizes
mkdir -p ./out
/usr/local/gcc-5.2.0/bin/g++-5.2.0 -c -o out/unit.o test/unit.cpp -Itest/include -O0 -g -DDEBUG -fno-inline-functions -Wall -pedantic -Wextra -Wsign-compare -Wsign-conversion -Wshadow -Wunused-parameter -std=c++11  -stdlib=libc++
g++-5.2.0: error: unrecognized command line option ‘-stdlib=libc++’
make: *** [out/unit.o] Error 1

The solution is to remove those flags - correctly setup toolchain will select correct run-time automatically.

artemp commented 8 years ago

@springmeyer 55579f0 fixes compilations with gcc on Darwin and all tests are passing https://travis-ci.org/mapbox/variant/builds/129431785

springmeyer commented 8 years ago

👍

springmeyer commented 8 years ago

I wonder if homebrew provides binaries of g++-5 we could use? Installing g++ from source on OSX travis machines would be a non-starter, but if we could pull binaries from homebrew then testing this might be feasible.