aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Neto <dneto@google.com>2017-12-11 13:27:25 -0500
committerDavid Neto <dneto@google.com>2017-12-11 13:28:54 -0500
commit90466a4e48690241df57a6896afba7fe367110d0 (patch)
tree13cc0f0fdf123a0462d2d8f9d2b9c8e6f2a70e22
parent847773f3d4dd71dc64a73613df5587c3e0f38030 (diff)
downloadeffcee-90466a4e48690241df57a6896afba7fe367110d0.tar.gz
Move ::testing::Combine workaround to top
The fix must be visible to compilation in the effcee/ tree as well.
-rw-r--r--CMakeLists.txt6
-rw-r--r--third_party/CMakeLists.txt5
2 files changed, 6 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fcae553..3a2e1b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,12 @@ enable_testing()
option(EFFCEE_BUILD_TESTING "Enable testing for Effcee" ON)
if(${EFFCEE_BUILD_TESTING})
message(STATUS "Configuring Effcee to build tests.")
+ if(MSVC)
+ # Our tests use ::testing::Combine. Force the ability to use it, working
+ # around googletest's possibly faulty compiler detection logic.
+ # See https://github.com/google/googletest/issues/1352
+ add_definitions(-DGTEST_HAS_COMBINE=1)
+ endif(MSVC)
else()
message(STATUS "Configuring Effcee to avoid building tests.")
endif()
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index c89ff91..4137510 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -24,11 +24,6 @@ endif()
# Configure third party projects.
if(EFFCEE_BUILD_TESTING)
- # Our tests use ::testing::Combine. Force the ability to use it, working
- # around googletest's possibly faulty compiler detection logic.
- # See https://github.com/google/googletest/issues/1352
- add_definitions(-DGTEST_HAS_COMBINE=1)
-
if (NOT TARGET gmock)
if (IS_DIRECTORY ${EFFCEE_GOOGLETEST_DIR})
add_subdirectory(${EFFCEE_GOOGLETEST_DIR} googletest)