From eb534ea5cb1d52dfa1a2f8c31aa388d511474c0d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 4 Oct 2023 16:55:01 -0400 Subject: Tests: Modernize name of RunCMake.CXXModules compiler inspection case We use the case name `Inspect` for similar purposes in other tests. --- Tests/RunCMake/CXXModules/Inspect.cmake | 28 ++++++++++++++++++++++ Tests/RunCMake/CXXModules/RunCMakeTest.cmake | 4 ++-- .../CXXModules/compiler_introspection.cmake | 28 ---------------------- 3 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 Tests/RunCMake/CXXModules/Inspect.cmake delete mode 100644 Tests/RunCMake/CXXModules/compiler_introspection.cmake diff --git a/Tests/RunCMake/CXXModules/Inspect.cmake b/Tests/RunCMake/CXXModules/Inspect.cmake new file mode 100644 index 0000000..8c74940 --- /dev/null +++ b/Tests/RunCMake/CXXModules/Inspect.cmake @@ -0,0 +1,28 @@ +enable_language(CXX) + +set(info "") + +# See `Modules/Compiler/MSVC-CXX.cmake` for this. If there is explicitly no +# default, the feature list is populated to be everything. +if (DEFINED CMAKE_CXX_STANDARD_DEFAULT AND + CMAKE_CXX_STANDARD_DEFAULT STREQUAL "") + set(CMAKE_CXX_COMPILE_FEATURES "") +endif () + +# Detect if the environment forces a C++ standard, let the test selection know. +set(forced_cxx_standard 0) +if (CMAKE_CXX_FLAGS MATCHES "-std=") + set(forced_cxx_standard 1) +endif () + +# Forward information about the C++ compile features. +string(APPEND info "\ +set(CMAKE_CXX_COMPILE_FEATURES \"${CMAKE_CXX_COMPILE_FEATURES}\") +set(CMAKE_MAKE_PROGRAM \"${CMAKE_MAKE_PROGRAM}\") +set(forced_cxx_standard \"${forced_cxx_standard}\") +set(CMAKE_CXX_COMPILER_VERSION \"${CMAKE_CXX_COMPILER_VERSION}\") +set(CMAKE_CXX_OUTPUT_EXTENSION \"${CMAKE_CXX_OUTPUT_EXTENSION}\") +set(CXXModules_default_build_type \"${CMAKE_BUILD_TYPE}\") +") + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake" "${info}") diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index 8b22687..dd18d20 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -3,8 +3,8 @@ include(RunCMake) # For `if (IN_LIST)` cmake_policy(SET CMP0057 NEW) -run_cmake(compiler_introspection) -include("${RunCMake_BINARY_DIR}/compiler_introspection-build/info.cmake") +run_cmake(Inspect) +include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake") # Test negative cases where C++20 modules do not work. run_cmake(NoCXX) diff --git a/Tests/RunCMake/CXXModules/compiler_introspection.cmake b/Tests/RunCMake/CXXModules/compiler_introspection.cmake deleted file mode 100644 index 8c74940..0000000 --- a/Tests/RunCMake/CXXModules/compiler_introspection.cmake +++ /dev/null @@ -1,28 +0,0 @@ -enable_language(CXX) - -set(info "") - -# See `Modules/Compiler/MSVC-CXX.cmake` for this. If there is explicitly no -# default, the feature list is populated to be everything. -if (DEFINED CMAKE_CXX_STANDARD_DEFAULT AND - CMAKE_CXX_STANDARD_DEFAULT STREQUAL "") - set(CMAKE_CXX_COMPILE_FEATURES "") -endif () - -# Detect if the environment forces a C++ standard, let the test selection know. -set(forced_cxx_standard 0) -if (CMAKE_CXX_FLAGS MATCHES "-std=") - set(forced_cxx_standard 1) -endif () - -# Forward information about the C++ compile features. -string(APPEND info "\ -set(CMAKE_CXX_COMPILE_FEATURES \"${CMAKE_CXX_COMPILE_FEATURES}\") -set(CMAKE_MAKE_PROGRAM \"${CMAKE_MAKE_PROGRAM}\") -set(forced_cxx_standard \"${forced_cxx_standard}\") -set(CMAKE_CXX_COMPILER_VERSION \"${CMAKE_CXX_COMPILER_VERSION}\") -set(CMAKE_CXX_OUTPUT_EXTENSION \"${CMAKE_CXX_OUTPUT_EXTENSION}\") -set(CXXModules_default_build_type \"${CMAKE_BUILD_TYPE}\") -") - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake" "${info}") -- cgit v0.12