-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compilation for G++4.7 on Ubuntu 13.04 #1
Conversation
Ubuntu is shipped with G++4.7 To run Bandit specs with G++4.7, I needed to: * update compile flags via CMakeLists.txt * add <stdexcept> header to bandit.h (otherwise, got and error with assertion_exception.h) * add <string.h> header to specs/util/argv_helper.h in order to use strlen
On Ubuntu 13.04, the patch works for both G++4.7 and Clang++3.2 With Clangmkdir build-clang; cd build-clang; CC=clang CXX=clang++ cmake ..;make
-- The C compiler identification is Clang 3.2.0
-- The CXX compiler identification is Clang 3.2.0
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bertrand/Desktop/bandit/build-clang
Scanning dependencies of target bandit-specs
[ 12%] Building CXX object CMakeFiles/bandit-specs.dir/specs/synopsis.spec.cpp.o
[ 25%] Building CXX object CMakeFiles/bandit-specs.dir/specs/before_each_after_each.spec.cpp.o
[ 37%] Building CXX object CMakeFiles/bandit-specs.dir/specs/describe.spec.cpp.o
[ 50%] Building CXX object CMakeFiles/bandit-specs.dir/specs/fuzzbox.spec.cpp.o
[ 62%] Building CXX object CMakeFiles/bandit-specs.dir/specs/main.cpp.o
[ 75%] Building CXX object CMakeFiles/bandit-specs.dir/specs/run.spec.cpp.o
[ 87%] Building CXX object CMakeFiles/bandit-specs.dir/specs/it.spec.cpp.o
[100%] Building CXX object CMakeFiles/bandit-specs.dir/specs/reporters/dots_reporter.spec.cpp.o
Linking CXX executable bin/bandit-specs
.......................................
Test run complete. 39 tests run. 39 succeeded.
[100%] Built target bandit-specs With GCCmkdir build-gcc; cd build-gcc; CC=gcc CXX=g++ cmake ..;make
-- The C compiler identification is GNU 4.7.3
-- The CXX compiler identification is GNU 4.7.3
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bertrand/Desktop/bandit/build-gcc
Scanning dependencies of target bandit-specs
[ 12%] Building CXX object CMakeFiles/bandit-specs.dir/specs/synopsis.spec.cpp.o
[ 25%] Building CXX object CMakeFiles/bandit-specs.dir/specs/before_each_after_each.spec.cpp.o
[ 37%] Building CXX object CMakeFiles/bandit-specs.dir/specs/describe.spec.cpp.o
[ 50%] Building CXX object CMakeFiles/bandit-specs.dir/specs/fuzzbox.spec.cpp.o
[ 62%] Building CXX object CMakeFiles/bandit-specs.dir/specs/main.cpp.o
[ 75%] Building CXX object CMakeFiles/bandit-specs.dir/specs/run.spec.cpp.o
[ 87%] Building CXX object CMakeFiles/bandit-specs.dir/specs/it.spec.cpp.o
[100%] Building CXX object CMakeFiles/bandit-specs.dir/specs/reporters/dots_reporter.spec.cpp.o
Linking CXX executable bin/bandit-specs
.......................................
Test run complete. 39 tests run. 39 succeeded.
[100%] Built target bandit-specs
|
I'm running on Mac OS with clang 4.2.0. I need the -stdlib=libc++ flag. I just pushed a version where I try to make that flag conditional of whether the compiler supports them or not. Does that work for you? |
It works with GCC47 but not with Clang3.2 |
…ter output Addresses issue banditcpp#1
Ubuntu is shipped with G++4.7
To run Bandit specs with G++4.7, I needed to: