diff options
28 files changed, 186 insertions, 103 deletions
diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 2bd3e94..81e9ce2 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -7,7 +7,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake ci ext/$CI_CONCURRENT_ID" # TODO: Factor this out so that each job selects the Xcode version to # use so that different versions can be tested in a single pipeline. - DEVELOPER_DIR: "/Applications/Xcode-15.1.app/Contents/Developer" + DEVELOPER_DIR: "/Applications/Xcode-15.2.app/Contents/Developer" # Avoid conflicting with other projects running on the same machine. SCCACHE_SERVER_PORT: 4227 @@ -135,7 +135,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-x86_64 - shell - - xcode-15.1 + - xcode-15.2 - nonconcurrent .macos_x86_64_tags_ext: @@ -143,7 +143,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-x86_64 - shell - - xcode-15.1 + - xcode-15.2 - concurrent .macos_arm64_tags: @@ -151,7 +151,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-15.1 + - xcode-15.2 - nonconcurrent .macos_arm64_tags_ext: @@ -159,7 +159,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-15.1 + - xcode-15.2 - concurrent .macos_arm64_tags_package: @@ -167,7 +167,7 @@ - cmake # Since this is a bare runner, pin to a project. - macos-arm64 - shell - - xcode-15.1 + - xcode-15.2 - nonconcurrent - finder diff --git a/Help/release/3.28.rst b/Help/release/3.28.rst index 166bed9..9a0783f 100644 --- a/Help/release/3.28.rst +++ b/Help/release/3.28.rst @@ -207,3 +207,8 @@ Changes made since CMake 3.28.0 include the following. * These versions made no changes to documented features or interfaces. Some implementation updates were made to support ecosystem changes and/or fix regressions. + +.. 3.28.4 (unreleased) + + * Apple visionOS support has been updated for the official Xcode 15.2 + release of the ``xros`` and ``xrsimulator`` SDKs. diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 4f1eaba..dde2b28 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -1173,7 +1173,7 @@ function(CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX lang userflags) ENCODING AUTO # cl prints in console output code page ) string(REPLACE "\n" "\n " msg " ${out}") - if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n][^:\n]+:[^:\n]*[^: \n][^: \n]:?[ \t]+)([A-Za-z]:\\\\|\\./|/)") + if(res EQUAL 0 AND "${out}" MATCHES "(^|\n)([^:\n][^:\n]+:[^:\n]*[^: \n][^: \n]:?[ \t]+)([A-Za-z]:\\\\|\\./|\\.\\\\|/)") set(CMAKE_${lang}_CL_SHOWINCLUDES_PREFIX "${CMAKE_MATCH_2}" PARENT_SCOPE) string(APPEND msg "\nFound prefix \"${CMAKE_MATCH_2}\"") else() diff --git a/Modules/FindCUDAToolkit.cmake b/Modules/FindCUDAToolkit.cmake index 469a7ad..6b8b08e 100644 --- a/Modules/FindCUDAToolkit.cmake +++ b/Modules/FindCUDAToolkit.cmake @@ -1136,18 +1136,12 @@ if(CUDAToolkit_FOUND) _CUDAToolkit_find_and_add_import_lib(cuda_driver ALT cuda) - _CUDAToolkit_find_and_add_import_lib(cudart) - _CUDAToolkit_find_and_add_import_lib(cudart_static) - # setup dependencies that are required for cudart_static when building + # setup dependencies that are required for cudart/cudart_static when building # on linux. These are generally only required when using the CUDA toolkit # when CUDA language is disabled - if(NOT TARGET CUDA::cudart_static_deps - AND TARGET CUDA::cudart_static) - + if(NOT TARGET CUDA::cudart_static_deps) add_library(CUDA::cudart_static_deps IMPORTED INTERFACE) - target_link_libraries(CUDA::cudart_static INTERFACE CUDA::cudart_static_deps) - if(UNIX AND (CMAKE_C_COMPILER OR CMAKE_CXX_COMPILER)) find_package(Threads REQUIRED) target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS}) @@ -1165,6 +1159,9 @@ if(CUDAToolkit_FOUND) endif() endif() + _CUDAToolkit_find_and_add_import_lib(cudart DEPS cudart_static_deps) + _CUDAToolkit_find_and_add_import_lib(cudart_static DEPS cudart_static_deps) + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.0.0) _CUDAToolkit_find_and_add_import_lib(nvJitLink) _CUDAToolkit_find_and_add_import_lib(nvJitLink_static DEPS cudart_static_deps) diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 18255b6..15c3f64 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -485,18 +485,7 @@ function(matlab_extract_all_installed_versions_from_registry win64 matlab_versio foreach(_match IN LISTS _versions_regex) if(_match MATCHES "([0-9]+(\\.[0-9]+)+)") - cmake_host_system_information(RESULT _reg - QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Mathworks/${_installation_type}/${CMAKE_MATCH_1}" - VALUE "MATLABROOT" - VIEW ${_view} - ) - - _Matlab_VersionInfoXML("${_reg}" _matlab_version_tmp) - if("${_matlab_version_tmp}" STREQUAL "unknown") - list(APPEND matlabs_from_registry ${_match}) - else() - list(APPEND matlabs_from_registry ${_matlab_version_tmp}) - endif() + list(APPEND matlabs_from_registry ${_match}) endif() endforeach() diff --git a/Modules/Platform/Apple-Clang.cmake b/Modules/Platform/Apple-Clang.cmake index 57b3910..61a6cd2 100644 --- a/Modules/Platform/Apple-Clang.cmake +++ b/Modules/Platform/Apple-Clang.cmake @@ -26,10 +26,10 @@ macro(__apple_compiler_clang lang) set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtvos-version-min=") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/AppleTVSimulator") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtvos-simulator-version-min=") - elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XROS") - set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtargetos=xros") + elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XROS") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "--target=<ARCH>-apple-xros<VERSION_MIN>") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/XRSimulator") - set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mtargetos=xros") + set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "--target=<ARCH>-apple-xros<VERSION_MIN>-simulator") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/WatchOS") set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "-mwatchos-version-min=") elseif(_CMAKE_OSX_SYSROOT_PATH MATCHES "/WatchSimulator") diff --git a/Source/cmDyndepCollation.cxx b/Source/cmDyndepCollation.cxx index edf56ff..2ce0f54 100644 --- a/Source/cmDyndepCollation.cxx +++ b/Source/cmDyndepCollation.cxx @@ -119,7 +119,8 @@ Json::Value CollationInformationCxxModules( for (auto const& files_per_dir : files_per_dirs) { for (auto const& file : files_per_dir.second) { - auto lookup = sf_map.find(file); + auto const full_file = cmSystemTools::CollapseFullPath(file); + auto lookup = sf_map.find(full_file); if (lookup == sf_map.end()) { gt->Makefile->IssueMessage( MessageType::FATAL_ERROR, @@ -147,7 +148,7 @@ Json::Value CollationInformationCxxModules( Json::Value& tdi_module_info = tdi_cxx_module_info[obj_path] = Json::objectValue; - tdi_module_info["source"] = file; + tdi_module_info["source"] = full_file; tdi_module_info["bmi-only"] = ct == CompileType::BmiOnly; tdi_module_info["relative-directory"] = files_per_dir.first; tdi_module_info["name"] = file_set->GetName(); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 3e98341..86c55f5 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1978,14 +1978,49 @@ void cmLocalGenerator::AddArchitectureFlags(std::string& flags, cmValue deploymentTarget = this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); - std::string deploymentTargetFlagVar = - "CMAKE_" + lang + "_OSX_DEPLOYMENT_TARGET_FLAG"; - cmValue deploymentTargetFlag = - this->Makefile->GetDefinition(deploymentTargetFlagVar); - if (cmNonempty(deploymentTargetFlag) && cmNonempty(deploymentTarget)) { - flags += " "; - flags += *deploymentTargetFlag; - flags += *deploymentTarget; + if (cmNonempty(deploymentTarget)) { + std::string deploymentTargetFlagVar = + "CMAKE_" + lang + "_OSX_DEPLOYMENT_TARGET_FLAG"; + cmValue deploymentTargetFlag = + this->Makefile->GetDefinition(deploymentTargetFlagVar); + if (cmNonempty(deploymentTargetFlag) && + // CMAKE_<LANG>_COMPILER_TARGET overrides a --target= for + // CMAKE_OSX_DEPLOYMENT_TARGET, e.g., for visionOS. + (!cmHasLiteralPrefix(*deploymentTarget, "--target=") || + this->Makefile + ->GetDefinition(cmStrCat("CMAKE_", lang, "_COMPILER_TARGET")) + .IsEmpty())) { + std::string flag = *deploymentTargetFlag; + + // Add the deployment target architecture to the flag, if needed. + static const std::string kARCH = "<ARCH>"; + std::string::size_type archPos = flag.find(kARCH); + if (archPos != std::string::npos) { + // This placeholder is meant for visionOS, so default to arm64 + // unless only non-arm64 archs are given. + std::string const arch = + (archs.empty() || cm::contains(archs, "arm64")) ? "arm64" + : archs[0]; + // Replace the placeholder with its value. + flag = cmStrCat(flag.substr(0, archPos), arch, + flag.substr(archPos + kARCH.size())); + } + + // Add the deployment target version to the flag. + static const std::string kVERSION_MIN = "<VERSION_MIN>"; + std::string::size_type verPos = flag.find(kVERSION_MIN); + if (verPos != std::string::npos) { + // Replace the placeholder with its value. + flag = cmStrCat(flag.substr(0, verPos), *deploymentTarget, + flag.substr(verPos + kVERSION_MIN.size())); + } else { + // There is no placeholder, so append the value. + flag = cmStrCat(flag, *deploymentTarget); + } + + flags += " "; + flags += flag; + } } } } diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx index cd452cb..b0f1cf1 100644 --- a/Source/cmUVProcessChain.cxx +++ b/Source/cmUVProcessChain.cxx @@ -311,6 +311,11 @@ void cmUVProcessChain::InternalData::SpawnProcess( arguments.push_back(nullptr); options.args = const_cast<char**>(arguments.data()); options.flags = UV_PROCESS_WINDOWS_HIDE; +#if UV_VERSION_MAJOR > 1 || \ + (UV_VERSION_MAJOR == 1 && UV_VERSION_MINOR >= 48) || \ + !defined(CMAKE_USE_SYSTEM_LIBUV) + options.flags |= UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME; +#endif if (!this->Builder->WorkingDirectory.empty()) { options.cwd = this->Builder->WorkingDirectory.c_str(); } diff --git a/Tests/CommandLength/CMakeLists.txt b/Tests/CommandLength/CMakeLists.txt index 6836051..8d75172 100644 --- a/Tests/CommandLength/CMakeLists.txt +++ b/Tests/CommandLength/CMakeLists.txt @@ -10,7 +10,10 @@ set(msg "${msg} ${msg}") set(msg "${msg} ${msg}") set(msg "${msg} ${msg}") set(msg "${msg} ${msg}") -foreach(i RANGE 1 1000) +set(msg "${msg} ${msg}") +set(msg "${msg} ${msg}") +set(msg "${msg} ${msg}") +foreach(i RANGE 1 125) add_custom_command(TARGET CommandLength POST_BUILD VERBATIM COMMAND ${CMAKE_COMMAND} -E echo "${i} ${msg}" > log/${i} ) diff --git a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake index b996df0..ff78d5a 100644 --- a/Tests/RunCMake/CXXModules/RunCMakeTest.cmake +++ b/Tests/RunCMake/CXXModules/RunCMakeTest.cmake @@ -184,6 +184,7 @@ run_cxx_module_test(scan-with-pch) # Tests which use named modules. if ("named" IN_LIST CMake_TEST_MODULE_COMPILATION) run_cxx_module_test(simple) + run_cxx_module_test(file-sets-with-dot) run_cxx_module_test(vs-without-flags) run_cxx_module_test(library library-static -DBUILD_SHARED_LIBS=OFF) run_cxx_module_test(unity-build) diff --git a/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/CMakeLists.txt b/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/CMakeLists.txt new file mode 100644 index 0000000..2b16a6a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.28) +project(cxx_modules_file_sets_with_dot CXX) + +include("${CMAKE_SOURCE_DIR}/../cxx-modules-rules.cmake") + +add_executable(file_sets_with_dot) +target_sources(file_sets_with_dot + PRIVATE + ./main.cxx + PRIVATE + FILE_SET CXX_MODULES + BASE_DIRS + "${CMAKE_CURRENT_SOURCE_DIR}" + FILES + ./importable.cxx) +target_compile_features(file_sets_with_dot PUBLIC cxx_std_20) + +add_test(NAME file_sets_with_dot COMMAND file_sets_with_dot) diff --git a/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/importable.cxx b/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/importable.cxx new file mode 100644 index 0000000..607680a --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/importable.cxx @@ -0,0 +1,6 @@ +export module importable; + +export int from_import() +{ + return 0; +} diff --git a/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/main.cxx b/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/main.cxx new file mode 100644 index 0000000..feb38d2 --- /dev/null +++ b/Tests/RunCMake/CXXModules/examples/file-sets-with-dot/main.cxx @@ -0,0 +1,6 @@ +import importable; + +int main(int argc, char* argv[]) +{ + return from_import(); +} diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 13d9620..2df300c 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -46,7 +46,8 @@ if(WIN32) if(RunCMake_MAKE_PROGRAM) set(maybe_MAKE_PROGRAM "-DRunCMake_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM}") endif() - run_cmake_script(ShowIncludes-437-ClangCl -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) + run_cmake_script(ShowIncludes-437-ClangCl-17 -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) + run_cmake_script(ShowIncludes-437-ClangCl-18 -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) run_cmake_script(ShowIncludes-437-English -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) run_cmake_script(ShowIncludes-437-French -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) run_cmake_script(ShowIncludes-437-German -DshowIncludes=${showIncludes} ${maybe_MAKE_PROGRAM}) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-17-check.cmake index 6136463..3ebdb4f 100644 --- a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-check.cmake +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-17-check.cmake @@ -1,3 +1,3 @@ -# 'clang-cl /showIncludes' prefix. +# 'clang-cl /showIncludes' prefix for clang-cl <= 17. set(expect "Note: including file: ") include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-17-stdout.txt index bda7eab..bda7eab 100644 --- a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-stdout.txt +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-17-stdout.txt diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-17.cmake index 7eca3d3..9642f06 100644 --- a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl.cmake +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-17.cmake @@ -1,3 +1,3 @@ set(CODEPAGE 437) -set(VSLANG "clang-cl") # Special case for test, not a real VS value. +set(VSLANG "clang-cl-17") # Special case for test, not a real VS value. include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18-check.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18-check.cmake new file mode 100644 index 0000000..a42af86 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18-check.cmake @@ -0,0 +1,3 @@ +# 'clang-cl /showIncludes' prefix for clang-cl >= 18. +set(expect "Note: including file: ") +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes-check.cmake) diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18-stdout.txt b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18-stdout.txt new file mode 100644 index 0000000..bda7eab --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18-stdout.txt @@ -0,0 +1 @@ +-- showIncludes='Note: including file: ' diff --git a/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18.cmake b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18.cmake new file mode 100644 index 0000000..997ffb9 --- /dev/null +++ b/Tests/RunCMake/Ninja/ShowIncludes-437-ClangCl-18.cmake @@ -0,0 +1,3 @@ +set(CODEPAGE 437) +set(VSLANG "clang-cl-18") # Special case for test, not a real VS value. +include(${CMAKE_CURRENT_LIST_DIR}/ShowIncludes.cmake) diff --git a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake index 9a13892..75adb00 100644 --- a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake @@ -14,17 +14,15 @@ function(create_libraries type) create_library(${type} ios iOS "arm64" iphoneos) create_library(${type} tvos tvOS "arm64" appletvos) create_library(${type} watchos watchOS "armv7k\\\\;arm64_32" watchos) - #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. - #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) - # create_library(${type} visionos visionOS "arm64" xros) - #endif() + if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15.2) + create_library(${type} visionos visionOS "arm64" xros) + endif() create_library(${type} ios-simulator iOS "${macos_archs_2}" iphonesimulator) create_library(${type} tvos-simulator tvOS "${macos_archs_2}" appletvsimulator) create_library(${type} watchos-simulator watchOS "${watch_sim_archs_2}" watchsimulator) - #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. - #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) - # create_library(${type} visionos-simulator visionOS "${macos_archs_2}" xrsimulator) - #endif() + if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15.2) + create_library(${type} visionos-simulator visionOS "${macos_archs_2}" xrsimulator) + endif() endfunction() function(create_xcframework name type platforms) @@ -62,24 +60,21 @@ function(create_executables name type) create_executable(${name}-ios ${type} iOS "arm64" iphoneos) create_executable(${name}-tvos ${type} tvOS "arm64" appletvos) create_executable(${name}-watchos ${type} watchOS "armv7k\\\\;arm64_32" watchos) - #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. - #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) - # create_executable(${name}-visionos ${type} visionOS "arm64" xros) - #endif() + if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15.2) + create_executable(${name}-visionos ${type} visionOS "arm64" xros) + endif() create_executable(${name}-ios-simulator ${type} iOS "${macos_archs_2}" iphonesimulator) create_executable(${name}-tvos-simulator ${type} tvOS "${macos_archs_2}" appletvsimulator) create_executable(${name}-watchos-simulator ${type} watchOS "${watch_sim_archs_2}" watchsimulator) - #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. - #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) - # create_executable(${name}-visionos-simulator ${type} visionOS "${macos_archs_2}" xrsimulator) - #endif() + if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15.2) + create_executable(${name}-visionos-simulator ${type} visionOS "${macos_archs_2}" xrsimulator) + endif() endfunction() set(xcframework_platforms macos ios tvos watchos ios-simulator tvos-simulator watchos-simulator) -#FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. -#if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15) -# list(APPEND xcframework_platforms visionos visionos-simulator) -#endif() +if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15.2) + list(APPEND xcframework_platforms visionos visionos-simulator) +endif() if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12) set(macos_archs_1 "x86_64\\;arm64") set(macos_archs_2 "x86_64\\\\;arm64") diff --git a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c index c00fce7..91b413a 100644 --- a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c +++ b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c @@ -5,8 +5,8 @@ # if __MAC_OS_X_VERSION_MIN_REQUIRED != __MAC_10_11 # error macOS deployment version mismatch # endif -#elif TARGET_OS_XR -# if __XR_OS_VERSION_MIN_REQUIRED != __XROS_1_0 +#elif TARGET_OS_VISION +# if __VISION_OS_VERSION_MIN_REQUIRED != __VISIONOS_1_0 # error visionOS deployment version mismatch # endif #elif TARGET_OS_IOS diff --git a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake index e4dbb90..b61b7fc 100644 --- a/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject-Device/RunCMakeTest.cmake @@ -93,25 +93,24 @@ if(NOT XCODE_VERSION VERSION_LESS 7.1) unset(RunCMake_TEST_OPTIONS) endif() -#FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. -#if(NOT XCODE_VERSION VERSION_LESS 15) -# set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesVisionOS-build) -# set(RunCMake_TEST_NO_CLEAN 1) -# set(RunCMake_TEST_OPTIONS -# "-DCMAKE_SYSTEM_NAME=visionOS" -# "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install") -# -# file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") -# file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") -# -# run_cmake(XcodeBundles) -# run_cmake_command(XcodeBundles-build-visionOS ${CMAKE_COMMAND} --build .) -# run_cmake_command(XcodeBundles-install-visionOS ${CMAKE_COMMAND} --build . --target install) -# -# unset(RunCMake_TEST_BINARY_DIR) -# unset(RunCMake_TEST_NO_CLEAN) -# unset(RunCMake_TEST_OPTIONS) -#endif() +if(NOT XCODE_VERSION VERSION_LESS 15.2) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesVisionOS-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS + "-DCMAKE_SYSTEM_NAME=visionOS" + "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install") + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeBundles) + run_cmake_command(XcodeBundles-build-visionOS ${CMAKE_COMMAND} --build .) + run_cmake_command(XcodeBundles-install-visionOS ${CMAKE_COMMAND} --build . --target install) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_OPTIONS) +endif() if(NOT XCODE_VERSION VERSION_LESS 7) set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/osx.cmake") @@ -262,11 +261,10 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8) deployment_target_test(tvOS appletvsimulator) deployment_target_test(watchOS watchos) deployment_target_test(watchOS watchsimulator) - #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition. - #if(XCODE_VERSION VERSION_GREATER_EQUAL 15) - # deployment_target_test(visionOS xros) - # deployment_target_test(visionOS xrsimulator) - #endif() + if(XCODE_VERSION VERSION_GREATER_EQUAL 15.2) + deployment_target_test(visionOS xros) + deployment_target_test(visionOS xrsimulator) + endif() endif() if(XCODE_VERSION VERSION_GREATER_EQUAL 8) diff --git a/Tests/RunCMake/showIncludes.c b/Tests/RunCMake/showIncludes.c index 7d467cf..cfc8572 100644 --- a/Tests/RunCMake/showIncludes.c +++ b/Tests/RunCMake/showIncludes.c @@ -28,14 +28,22 @@ int main() printf("OEM code page: %u\n", GetOEMCP()); printf("VSLANG: %s\n", vslang); - // clang-cl (special case for test, not a real VS value). - if (strcmp(vslang, "clang-cl") == 0) { + // clang-cl <= 17 (special case for test, not a real VS value). + if (strcmp(vslang, "clang-cl-17") == 0) { if (cp == 437 || cp == 65001) { printf("Note: including file: ./foo.h\n"); return 0; } } + // clang-cl >= 18 (special case for test, not a real VS value). + if (strcmp(vslang, "clang-cl-18") == 0) { + if (cp == 437 || cp == 65001) { + printf("Note: including file: .\\\\foo.h\n"); + return 0; + } + } + // msvc-wine (special case for test, not a real VS value). if (strcmp(vslang, "msvc-wine") == 0) { if (cp == 437 || cp == 65001) { diff --git a/Utilities/cmlibuv/include/uv.h b/Utilities/cmlibuv/include/uv.h index ffe34ec..42e3446 100644 --- a/Utilities/cmlibuv/include/uv.h +++ b/Utilities/cmlibuv/include/uv.h @@ -1080,7 +1080,14 @@ enum uv_process_flags { * option is only meaningful on Windows systems. On Unix it is silently * ignored. */ - UV_PROCESS_WINDOWS_HIDE_GUI = (1 << 6) + UV_PROCESS_WINDOWS_HIDE_GUI = (1 << 6), + /* + * On Windows, if the path to the program to execute, specified in + * uv_process_options_t's file field, has a directory component, + * search for the exact file name before trying variants with + * extensions like '.exe' or '.cmd'. + */ + UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME = (1 << 7) }; /* diff --git a/Utilities/cmlibuv/src/unix/process.c b/Utilities/cmlibuv/src/unix/process.c index 30872cf..39ec451 100644 --- a/Utilities/cmlibuv/src/unix/process.c +++ b/Utilities/cmlibuv/src/unix/process.c @@ -1008,6 +1008,7 @@ int uv_spawn(uv_loop_t* loop, assert(!(options->flags & ~(UV_PROCESS_DETACHED | UV_PROCESS_SETGID | UV_PROCESS_SETUID | + UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME | UV_PROCESS_WINDOWS_HIDE | UV_PROCESS_WINDOWS_HIDE_CONSOLE | UV_PROCESS_WINDOWS_HIDE_GUI | diff --git a/Utilities/cmlibuv/src/win/process.c b/Utilities/cmlibuv/src/win/process.c index 7df3540..11cf5b2 100644 --- a/Utilities/cmlibuv/src/win/process.c +++ b/Utilities/cmlibuv/src/win/process.c @@ -329,10 +329,9 @@ static WCHAR* path_search_walk_ext(const WCHAR *dir, * - If there's really only a filename, check the current directory for file, * then search all path directories. * - * - If a full path is specified, search for the exact filename first. - * - * - If filename specified has *any* extension, search for the file with the - * specified extension first. + * - If filename specified has *any* extension, or already contains a path + * and the UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME flag is specified, + * search for the file with the exact specified filename first. * * - If the literal filename is not found in a directory, try *appending* * (not replacing) .com first and then .exe. @@ -358,7 +357,8 @@ static WCHAR* path_search_walk_ext(const WCHAR *dir, */ static WCHAR* search_path(const WCHAR *file, WCHAR *cwd, - const WCHAR *path) { + const WCHAR *path, + unsigned int flags) { int file_has_dir; WCHAR* result = NULL; WCHAR *file_name_start; @@ -394,14 +394,12 @@ static WCHAR* search_path(const WCHAR *file, name_has_ext = (dot != NULL && dot[1] != L'\0'); if (file_has_dir) { - /* The file has a path inside, don't use path - * Try the exact filename first, and then try standard extensions - */ + /* The file has a path inside, don't use path */ result = path_search_walk_ext( file, file_name_start - file, file_name_start, file_len - (file_name_start - file), cwd, cwd_len, - 1); + name_has_ext || (flags & UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME)); } else { dir_end = path; @@ -991,6 +989,7 @@ int uv_spawn(uv_loop_t* loop, assert(!(options->flags & ~(UV_PROCESS_DETACHED | UV_PROCESS_SETGID | UV_PROCESS_SETUID | + UV_PROCESS_WINDOWS_FILE_PATH_EXACT_NAME | UV_PROCESS_WINDOWS_HIDE | UV_PROCESS_WINDOWS_HIDE_CONSOLE | UV_PROCESS_WINDOWS_HIDE_GUI | @@ -1070,7 +1069,8 @@ int uv_spawn(uv_loop_t* loop, application_path = search_path(application, cwd, - path); + path, + options->flags); if (application_path == NULL) { /* Not found. */ err = ERROR_FILE_NOT_FOUND; |