Merge lp:~alan-griffiths/miral/fix-for-zesty-gtest into lp:miral

Proposed by Alan Griffiths
Status: Merged
Approved by: Gerry Boland
Approved revision: 459
Merged at revision: 458
Proposed branch: lp:~alan-griffiths/miral/fix-for-zesty-gtest
Merge into: lp:miral
Diff against target: 20 lines (+10/-0)
1 file modified
test/CMakeLists.txt (+10/-0)
To merge this branch: bzr merge lp:~alan-griffiths/miral/fix-for-zesty-gtest
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+312018@code.launchpad.net

Commit message

[tests] GTest relies on a gnu extension, so don't treat that extension as an error when compiling tests

To post a comment you must log in.
458. By Alan Griffiths

g++ treats all -pedantic warnings as one feature

459. By Alan Griffiths

g++ ignores clang command line flags

Revision history for this message
Gerry Boland (gerboland) wrote :

works on gcc

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test/CMakeLists.txt'
2--- test/CMakeLists.txt 2016-11-15 17:38:33 +0000
3+++ test/CMakeLists.txt 2016-11-29 10:34:25 +0000
4@@ -21,6 +21,16 @@
5 endif()
6 endif()
7
8+# We can't tell which version of gtest we're building against and INSTANTIATE_TEST_CASE_P changed in
9+# a way that relies on a gcc extension to support backward-compatible code, So...
10+check_cxx_compiler_flag(-Wno-gnu-zero-variadic-macro-arguments MIRAL_COMPILE_WITH_W_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
11+check_cxx_compiler_flag(-Wno-pedantic MIRAL_COMPILE_WITH_W_NO_PEDANTIC)
12+if ("${CMAKE_CXX_COMPILER}" MATCHES ".*clang.*" AND MIRAL_COMPILE_WITH_W_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS)
13+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") # clang
14+elseif(MIRAL_COMPILE_WITH_W_NO_PEDANTIC)
15+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pedantic") #gcc
16+endif()
17+
18 include_directories(
19 ${MIRTEST_INCLUDE_DIRS}
20 ${GMOCK_INCLUDE_DIR}

Subscribers

People subscribed via source and target branches