From 6e7980164593bfe888d6e94ee52d4d08bdddb412 Mon Sep 17 00:00:00 2001 From: Jacob Schloss Date: Wed, 22 Aug 2018 11:17:32 -0700 Subject: [PATCH] It seems like CMAKE_CXX_FLAGS is getting double appended when building as a nested cmake project, which breaks my build as gcc does not allow -specs=nosys.specs to be called multiple times. Removing this fixes it and seems to keep the same compile options, just removing the duplicate definition. --- googletest/cmake/internal_utils.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index b78dbcc7..dc9186e9 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -138,7 +138,7 @@ macro(config_compiler_and_linker) set(cxx_base_flags "${cxx_base_flags} ${GTEST_HAS_PTHREAD_MACRO}") # For building gtest's own tests and samples. - set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}") + set(cxx_exception "${cxx_base_flags} ${cxx_exception_flags}") set(cxx_no_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}") set(cxx_default "${cxx_exception}")