diff options
author | Olivier Ldff <olivier.ldff@gmail.com> | 2020-04-11 14:44:37 (GMT) |
---|---|---|
committer | Olivier LDff <olivier.ldff@gmail.com> | 2020-07-02 07:36:22 (GMT) |
commit | 131878ce9e18e3fcc5fdd690c93ee9d36f0a18d3 (patch) | |
tree | 87f4be2eaebab675677e806b6672bbe13c5c1d46 /googletest/cmake | |
parent | aee0f9d9b5b87796ee8a0ab26b7587ec30e8858e (diff) | |
download | googletest-131878ce9e18e3fcc5fdd690c93ee9d36f0a18d3.zip googletest-131878ce9e18e3fcc5fdd690c93ee9d36f0a18d3.tar.gz googletest-131878ce9e18e3fcc5fdd690c93ee9d36f0a18d3.tar.bz2 |
use target_compile_features to use c++11 if cmake > 3.8refs/pull/2808/head
If target_compile_features is available and cxx_std_11.
This fix compilation with clang and gcc when c++11 isn't specified by user.
Diffstat (limited to 'googletest/cmake')
-rw-r--r-- | googletest/cmake/internal_utils.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index 2f70f0b..b3e8b81 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -188,6 +188,10 @@ function(cxx_library_with_type name type cxx_flags) endif() target_link_libraries(${name} PUBLIC ${threads_spec}) endif() + + if (NOT "${CMAKE_VERSION}" VERSION_LESS "3.8") + target_compile_features(${name} PUBLIC cxx_std_11) + endif() endfunction() ######################################################################## |