diff options
-rwxr-xr-x | .gitlab/ci/wix.ps1 | 5 | ||||
-rw-r--r-- | Help/command/FIND_XXX.txt | 4 | ||||
-rw-r--r-- | Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst | 4 | ||||
-rw-r--r-- | Modules/FindLua.cmake | 29 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 12 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 14 | ||||
-rw-r--r-- | Tests/RunCMake/VerifyHeaderSets/AllVerifyInterfaceHeaderSets-all_verify_interface_header_sets-Debug-build-check.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/VerifyHeaderSets/AllVerifyInterfaceHeaderSets.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/VerifyHeaderSets/dir1/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/VerifyHeaderSets/dir1/lib1.h | 4 | ||||
-rw-r--r-- | Tests/RunCMake/VerifyHeaderSets/dir2/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/VerifyHeaderSets/dir2/lib2.h | 4 |
15 files changed, 82 insertions, 30 deletions
diff --git a/.gitlab/ci/wix.ps1 b/.gitlab/ci/wix.ps1 index a690533..b7cb3f3 100755 --- a/.gitlab/ci/wix.ps1 +++ b/.gitlab/ci/wix.ps1 @@ -2,13 +2,14 @@ $erroractionpreference = "stop" $release = "v3.14.0.6526" $sha256sum = "4C89898DF3BCAB13E12F7CA54399C35AD273475AD2CB6284611D00AE2D063C2C" -$filename = "wix314-binaries" +$filename = "wix-3.14.0.6526-win-i386" $tarball = "$filename.zip" $outdir = $pwd.Path $outdir = "$outdir\.gitlab" $ProgressPreference = 'SilentlyContinue' -Invoke-WebRequest -Uri "https://wixtoolset.org/downloads/$release/$tarball" -OutFile "$outdir\$tarball" +#Invoke-WebRequest -Uri "https://wixtoolset.org/downloads/$release/$tarball" -OutFile "$outdir\$tarball" +Invoke-WebRequest -Uri "https://cmake.org/files/dependencies/$tarball" -OutFile "$outdir\$tarball" $hash = Get-FileHash "$outdir\$tarball" -Algorithm SHA256 if ($hash.Hash -ne $sha256sum) { exit 1 diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt index 6683edb..83860b7 100644 --- a/Help/command/FIND_XXX.txt +++ b/Help/command/FIND_XXX.txt @@ -166,9 +166,9 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows: * |SYSTEM_ENVIRONMENT_PATH_WINDOWS_XXX| 6. Search cmake variables defined in the Platform files - for the current system. The searching of ``CMAKE_INSTALL_PREFIX` can be + for the current system. The searching of ``CMAKE_INSTALL_PREFIX`` can be skipped if ``NO_CMAKE_INSTALL_PREFIX`` is passed or by setting the - :variable:`CMAKE_FIND_USE_INSTALL_PREFIX` to ``FALSE. All these locations + :variable:`CMAKE_FIND_USE_INSTALL_PREFIX` to ``FALSE``. All these locations can be skipped if ``NO_CMAKE_SYSTEM_PATH`` is passed or by setting the :variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH` to ``FALSE``. diff --git a/Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst b/Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst index da461a7..dd415c8 100644 --- a/Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst +++ b/Help/prop_tgt/VERIFY_INTERFACE_HEADER_SETS.rst @@ -26,6 +26,10 @@ Otherwise, if C++ is enabled globally, the header is compiled as C++. Otherwise, if C is enabled globally, the header is compiled as C. Otherwise, the header file is not compiled. +If any verification targets are created, a top-level target called +``all_verify_interface_header_sets`` is created which depends on all +verification targets. + This property is initialized by the value of the :variable:`CMAKE_VERIFY_INTERFACE_HEADER_SETS` variable if it is set when a target is created. diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake index 32642fe..b56a7b1 100644 --- a/Modules/FindLua.cmake +++ b/Modules/FindLua.cmake @@ -10,19 +10,22 @@ Locate Lua library. .. versionadded:: 3.18 Support for Lua 5.4. -This module defines:: - -:: - - LUA_FOUND - if false, do not try to link to Lua - LUA_LIBRARIES - both lua and lualib - LUA_INCLUDE_DIR - where to find lua.h - LUA_VERSION_STRING - the version of Lua found - LUA_VERSION_MAJOR - the major version of Lua - LUA_VERSION_MINOR - the minor version of Lua - LUA_VERSION_PATCH - the patch version of Lua - - +This module defines: + +``LUA_FOUND`` + if false, do not try to link to Lua +``LUA_LIBRARIES`` + both lua and lualib +``LUA_INCLUDE_DIR`` + where to find lua.h +``LUA_VERSION_STRING`` + the version of Lua found +``LUA_VERSION_MAJOR`` + the major version of Lua +``LUA_VERSION_MINOR`` + the minor version of Lua +``LUA_VERSION_PATCH`` + the patch version of Lua Note that the expected include convention is diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 3bb8671..0c351ad 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -8535,6 +8535,9 @@ bool cmGeneratorTarget::AddHeaderSetVerification() } cmTarget* verifyTarget = nullptr; + cmTarget* allVerifyTarget = + this->GlobalGenerator->GetMakefiles().front()->FindTargetToUse( + "all_verify_interface_header_sets", true); auto interfaceFileSetEntries = this->Target->GetInterfaceHeaderSetsEntries(); @@ -8622,6 +8625,15 @@ bool cmGeneratorTarget::AddHeaderSetVerification() verifyTarget->FinalizeTargetCompileInfo( this->Makefile->GetCompileDefinitionsEntries(), perConfigCompileDefinitions); + + if (!allVerifyTarget) { + allVerifyTarget = this->GlobalGenerator->GetMakefiles() + .front() + ->AddNewUtilityTarget( + "all_verify_interface_header_sets", true); + } + + allVerifyTarget->AddUtility(verifyTarget->GetName(), false); } if (fileCgesContextSensitive) { diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index edc4118..4feae6d 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1758,6 +1758,14 @@ bool cmGlobalGenerator::AddHeaderSetVerification() } } + cmTarget* allVerifyTarget = this->Makefiles.front()->FindTargetToUse( + "all_verify_interface_header_sets", true); + if (allVerifyTarget) { + this->LocalGenerators.front()->AddGeneratorTarget( + cm::make_unique<cmGeneratorTarget>(allVerifyTarget, + this->LocalGenerators.front().get())); + } + return true; } diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 7eca963..7e36881 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -67,7 +67,7 @@ static bool VSHasDotNETFrameworkArm64() std::string dotNetArm64; return cmSystemTools::ReadRegistryValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework;InstallRootArm64", - dotNetArm64); + dotNetArm64, cmSystemTools::KeyWOW64_64); } static bool VSIsWindows11OrGreater() diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 78d3ad9..f077801 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -3358,22 +3358,12 @@ cmsys::Status cmSystemTools::CreateSymlink(std::string const& origName, uv_fs_t req; int flags = 0; #if defined(_WIN32) - bool const isDir = cmsys::SystemTools::FileIsDirectory(origName); - if (isDir) { - flags |= UV_FS_SYMLINK_JUNCTION; + if (cmsys::SystemTools::FileIsDirectory(origName)) { + flags |= UV_FS_SYMLINK_DIR; } #endif int err = uv_fs_symlink(nullptr, &req, origName.c_str(), newName.c_str(), flags, nullptr); -#if defined(_WIN32) - if (err && uv_fs_get_system_error(&req) == ERROR_NOT_SUPPORTED && isDir) { - // Try fallback to symlink for network (requires additional permissions). - flags ^= UV_FS_SYMLINK_JUNCTION | UV_FS_SYMLINK_DIR; - err = uv_fs_symlink(nullptr, &req, origName.c_str(), newName.c_str(), - flags, nullptr); - } -#endif - cmsys::Status status; if (err) { #if defined(_WIN32) diff --git a/Tests/RunCMake/VerifyHeaderSets/AllVerifyInterfaceHeaderSets-all_verify_interface_header_sets-Debug-build-check.cmake b/Tests/RunCMake/VerifyHeaderSets/AllVerifyInterfaceHeaderSets-all_verify_interface_header_sets-Debug-build-check.cmake new file mode 100644 index 0000000..d5a513a --- /dev/null +++ b/Tests/RunCMake/VerifyHeaderSets/AllVerifyInterfaceHeaderSets-all_verify_interface_header_sets-Debug-build-check.cmake @@ -0,0 +1,10 @@ +# A custom command is used to copy the header file from the source directory to +# the binary directory. If the verification target was built, the custom +# command should have been executed, and the file should be present in the +# binary directory. +if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/dir1/lib1.h") + string(APPEND RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/dir1/lib1.h should exist but it does not\n") +endif() +if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/dir2/lib2.h") + string(APPEND RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/dir2/lib2.h should exist but it does not\n") +endif() diff --git a/Tests/RunCMake/VerifyHeaderSets/AllVerifyInterfaceHeaderSets.cmake b/Tests/RunCMake/VerifyHeaderSets/AllVerifyInterfaceHeaderSets.cmake new file mode 100644 index 0000000..8948bac --- /dev/null +++ b/Tests/RunCMake/VerifyHeaderSets/AllVerifyInterfaceHeaderSets.cmake @@ -0,0 +1,4 @@ +enable_language(C) + +add_subdirectory(dir1) +add_subdirectory(dir2) diff --git a/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake b/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake index 9f9a1e7..b4fe720 100644 --- a/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake +++ b/Tests/RunCMake/VerifyHeaderSets/RunCMakeTest.cmake @@ -44,5 +44,11 @@ run_cmake_build(VerifyHeaderSets interface_lang_test_cxx_verify_interface_header run_cmake_build(VerifyHeaderSets list_verify_interface_header_sets) set(RunCMake_TEST_OPTIONS -DCMAKE_VERIFY_INTERFACE_HEADER_SETS=ON) +run_cmake(AllVerifyInterfaceHeaderSets) +unset(RunCMake_TEST_OPTIONS) + +run_cmake_build(AllVerifyInterfaceHeaderSets all_verify_interface_header_sets) + +set(RunCMake_TEST_OPTIONS -DCMAKE_VERIFY_INTERFACE_HEADER_SETS=ON) run_cmake(VerifyHeaderSetsNonexistent) unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/VerifyHeaderSets/dir1/CMakeLists.txt b/Tests/RunCMake/VerifyHeaderSets/dir1/CMakeLists.txt new file mode 100644 index 0000000..d26e933 --- /dev/null +++ b/Tests/RunCMake/VerifyHeaderSets/dir1/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(lib1 STATIC ../lib.c) +add_custom_command(OUTPUT lib1.h COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/lib1.h lib1.h) +target_sources(lib1 PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR} FILES ${CMAKE_CURRENT_BINARY_DIR}/lib1.h) diff --git a/Tests/RunCMake/VerifyHeaderSets/dir1/lib1.h b/Tests/RunCMake/VerifyHeaderSets/dir1/lib1.h new file mode 100644 index 0000000..69c37ed --- /dev/null +++ b/Tests/RunCMake/VerifyHeaderSets/dir1/lib1.h @@ -0,0 +1,4 @@ +#ifdef _WIN32 +__declspec(dllimport) +#endif + extern void lib1(void); diff --git a/Tests/RunCMake/VerifyHeaderSets/dir2/CMakeLists.txt b/Tests/RunCMake/VerifyHeaderSets/dir2/CMakeLists.txt new file mode 100644 index 0000000..8c3658c --- /dev/null +++ b/Tests/RunCMake/VerifyHeaderSets/dir2/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(lib2 STATIC ../lib.c) +add_custom_command(OUTPUT lib2.h COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/lib2.h lib2.h) +target_sources(lib2 PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR} FILES ${CMAKE_CURRENT_BINARY_DIR}/lib2.h) diff --git a/Tests/RunCMake/VerifyHeaderSets/dir2/lib2.h b/Tests/RunCMake/VerifyHeaderSets/dir2/lib2.h new file mode 100644 index 0000000..fa24a9a --- /dev/null +++ b/Tests/RunCMake/VerifyHeaderSets/dir2/lib2.h @@ -0,0 +1,4 @@ +#ifdef _WIN32 +__declspec(dllimport) +#endif + extern void lib2(void); |