diff options
-rw-r--r-- | Auxiliary/cmake-mode.el | 4 | ||||
-rw-r--r-- | Modules/CMakeDetermineSwiftCompiler.cmake | 12 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/Autogen/MocPredefs.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/RunCMake/CPack/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CheckCompilerFlag/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 2 |
8 files changed, 21 insertions, 19 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el index a11becb..7590ee3 100644 --- a/Auxiliary/cmake-mode.el +++ b/Auxiliary/cmake-mode.el @@ -372,7 +372,7 @@ optional argument topic will be appended to the argument list." (interactive "s") (let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*"))) (buffer (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname))) - (command (concat cmake-mode-cmake-executable " " type " " topic)) + (command (concat cmake-mode-cmake-executable " " type " " (shell-quote-argument topic))) ;; Turn of resizing of mini-windows for shell-command. (resize-mini-windows nil) ) @@ -391,7 +391,7 @@ optional argument topic will be appended to the argument list." (interactive "s") (let* ((bufname (if buffer buffer (concat "*CMake" type (if topic "-") topic "*"))) (buffer (if (get-buffer bufname) (get-buffer bufname) (generate-new-buffer bufname))) - (command (concat cmake-mode-cmake-executable " " type " " topic)) + (command (concat cmake-mode-cmake-executable " " type " " (shell-quote-argument topic))) ;; Turn of resizing of mini-windows for shell-command. (resize-mini-windows nil) ) diff --git a/Modules/CMakeDetermineSwiftCompiler.cmake b/Modules/CMakeDetermineSwiftCompiler.cmake index f0a63a8..7239424 100644 --- a/Modules/CMakeDetermineSwiftCompiler.cmake +++ b/Modules/CMakeDetermineSwiftCompiler.cmake @@ -15,7 +15,14 @@ if("${CMAKE_GENERATOR}" STREQUAL "Xcode") message(FATAL_ERROR "Swift language not supported by Xcode ${XCODE_VERSION}") endif() set(CMAKE_Swift_COMPILER_XCODE_TYPE sourcecode.swift) - _cmake_find_compiler_path(Swift) + execute_process(COMMAND xcrun --find swiftc + OUTPUT_VARIABLE _xcrun_out OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE _xcrun_err RESULT_VARIABLE _xcrun_result) + if(_xcrun_result EQUAL 0 AND EXISTS "${_xcrun_out}") + set(CMAKE_Swift_COMPILER "${_xcrun_out}") + else() + _cmake_find_compiler_path(Swift) + endif() elseif("${CMAKE_GENERATOR}" MATCHES "^Ninja") if(CMAKE_Swift_COMPILER) _cmake_find_compiler_path(Swift) @@ -52,9 +59,6 @@ if(NOT CMAKE_Swift_COMPILER_ID_RUN) if("${CMAKE_GENERATOR}" STREQUAL "Xcode") list(APPEND CMAKE_Swift_COMPILER_ID_MATCH_VENDORS Apple) set(CMAKE_Swift_COMPILER_ID_MATCH_VENDOR_REGEX_Apple "com.apple.xcode.tools.swift.compiler") - - set(CMAKE_Swift_COMPILER_ID_TOOL_MATCH_REGEX "\nCompileSwift[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]* -c[^\r\n]*CompilerIdSwift/CompilerId/main.swift") - set(CMAKE_Swift_COMPILER_ID_TOOL_MATCH_INDEX 2) endif() # Try to identify the compiler. diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 73f213e..afc37b2 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 26) -set(CMake_VERSION_PATCH 20230403) +set(CMake_VERSION_PATCH 20230404) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Tests/RunCMake/Autogen/MocPredefs.cmake b/Tests/RunCMake/Autogen/MocPredefs.cmake index 7a89bb5..8307e04 100644 --- a/Tests/RunCMake/Autogen/MocPredefs.cmake +++ b/Tests/RunCMake/Autogen/MocPredefs.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0129 NEW) enable_language(CXX) find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 080740c..f05f784 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -15,6 +15,9 @@ macro(add_RunCMake_test test) else() set(Test_Dir ${test}) endif() + if(CMAKE_C_COMPILER_ID STREQUAL "LCC") + list(APPEND TEST_ARGS -DRunCMake_TEST_LCC=1) + endif() add_test(NAME RunCMake.${test} COMMAND ${CMAKE_CMAKE_COMMAND} -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR} -DRunCMake_GENERATOR_IS_MULTI_CONFIG=${_isMultiConfig} @@ -41,6 +44,11 @@ function(add_RunCMake_test_group test types) file(REMOVE_RECURSE "${TEST_CONFIG_DIR}") file(MAKE_DIRECTORY "${TEST_CONFIG_DIR}") + set(TEST_ARGS "") + if(CMAKE_C_COMPILER_ID STREQUAL "LCC") + list(APPEND TEST_ARGS -DRunCMake_TEST_LCC=1) + endif() + foreach(type IN LISTS types) # generate prerequirements config file in cmake as ctest doesn't have as # much system information so it is easier to set programs and environment @@ -68,6 +76,7 @@ function(add_RunCMake_test_group test types) -DRunCMake_MAKE_PROGRAM=${CMake_TEST_EXPLICIT_MAKE_PROGRAM} -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test} -DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${type}/${test} + ${TEST_ARGS} -Dconfig_file=${TEST_CONFIG_DIR}/${type}_config.cmake -P "${CMAKE_CURRENT_SOURCE_DIR}/${test}/RunCMakeTest.cmake" ) diff --git a/Tests/RunCMake/CPack/CMakeLists.txt b/Tests/RunCMake/CPack/CMakeLists.txt index f210474..18a673e 100644 --- a/Tests/RunCMake/CPack/CMakeLists.txt +++ b/Tests/RunCMake/CPack/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -if(POLICY CMP0129) - cmake_policy(SET CMP0129 NEW) -endif() - set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "") project(${RunCMake_TEST} CXX) diff --git a/Tests/RunCMake/CheckCompilerFlag/CMakeLists.txt b/Tests/RunCMake/CheckCompilerFlag/CMakeLists.txt index 30cb9ae..67eae65 100644 --- a/Tests/RunCMake/CheckCompilerFlag/CMakeLists.txt +++ b/Tests/RunCMake/CheckCompilerFlag/CMakeLists.txt @@ -1,9 +1,3 @@ cmake_minimum_required(VERSION 3.13) - -if(POLICY CMP0129) - cmake_policy(SET CMP0129 NEW) -endif() - project(${RunCMake_TEST} LANGUAGES NONE) - include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index e1c923d..43fd961 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -94,7 +94,7 @@ function(run_cmake test) if(APPLE) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0025=NEW) endif() - if(NOT RunCMake_TEST_NO_CMP0129 AND CMAKE_C_COMPILER_ID STREQUAL "LCC") + if(RunCMake_TEST_LCC AND NOT RunCMake_TEST_NO_CMP0129) list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0129=NEW) endif() if(RunCMake_MAKE_PROGRAM) |