mirror of
https://git.mirrors.martin98.com/https://github.com/google/googletest.git
synced 2025-08-05 05:00:36 +08:00
use target_compile_features to use c++11 if cmake > 3.8
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.
This commit is contained in:
parent
aee0f9d9b5
commit
131878ce9e
@ -188,6 +188,10 @@ function(cxx_library_with_type name type cxx_flags)
|
|||||||
endif()
|
endif()
|
||||||
target_link_libraries(${name} PUBLIC ${threads_spec})
|
target_link_libraries(${name} PUBLIC ${threads_spec})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT "${CMAKE_VERSION}" VERSION_LESS "3.8")
|
||||||
|
target_compile_features(${name} PUBLIC cxx_std_11)
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user