Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChris Thrasher2024-03-12 13:19:31 -0600
committerMartin Hořeňovský2024-03-12 22:54:09 +0100
commit1a44e6f6616fb9cdcf2758ced3add9bd7d52208c (patch)
tree976bf7803824f49caa1fe9ab7210724d86a17c10
parent459ac8562b4f4b23280003beabeca910e823627a (diff)
downloadcatch3-1a44e6f6616fb9cdcf2758ced3add9bd7d52208c.tar.gz
Use built-in CMake feature for requiring a specific language standard
This feature was added in CMake 3.8. Requiring specific language features is an outdated approach that CMake stopped supporting in favor of simply specifyin the specific language standard you want. https://cmake.org/cmake/help/v3.10/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html
-rw-r--r--src/CMakeLists.txt44
1 files changed, 3 insertions, 41 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0b200425..28cd4e25 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -362,29 +362,10 @@ set_target_properties(Catch2 PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION})
-# depend on bunch of C++11 and C++14 features to have C++14 enabled by default
+# require C++14
target_compile_features(Catch2
PUBLIC
- cxx_alignas
- cxx_alignof
- cxx_attributes
- cxx_auto_type
- cxx_constexpr
- cxx_defaulted_functions
- cxx_deleted_functions
- cxx_final
- cxx_lambdas
- cxx_noexcept
- cxx_override
- cxx_range_for
- cxx_rvalue_references
- cxx_static_assert
- cxx_strong_enums
- cxx_trailing_return_types
- cxx_unicode_literals
- cxx_user_literals
- cxx_variable_templates
- cxx_variadic_macros
+ cxx_std_14
)
configure_file(
@@ -475,26 +456,7 @@ if (CATCH_BUILD_EXAMPLES OR CATCH_BUILD_EXTRA_TESTS)
)
target_compile_features(Catch2_buildall_interface
INTERFACE
- cxx_alignas
- cxx_alignof
- cxx_attributes
- cxx_auto_type
- cxx_constexpr
- cxx_defaulted_functions
- cxx_deleted_functions
- cxx_final
- cxx_lambdas
- cxx_noexcept
- cxx_override
- cxx_range_for
- cxx_rvalue_references
- cxx_static_assert
- cxx_strong_enums
- cxx_trailing_return_types
- cxx_unicode_literals
- cxx_user_literals
- cxx_variable_templates
- cxx_variadic_macros
+ cxx_std_14
)
endif()