summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auxiliary/cmake-mode.el18
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/policy/CMP0160.rst39
-rw-r--r--Help/release/dev/IntelLLVM-isystem-flag.rst6
-rw-r--r--Help/release/dev/cuda-clang-windows.rst5
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake4
-rw-r--r--Modules/Compiler/Clang.cmake1
-rw-r--r--Modules/Compiler/IntelLLVM.cmake6
-rw-r--r--Modules/FindFreetype.cmake98
-rw-r--r--Modules/FindMatlab.cmake38
-rw-r--r--Modules/Internal/CPack/CPackRPM.cmake6
-rw-r--r--Modules/Internal/CPack/WIX.template.in1
-rw-r--r--Modules/Platform/Windows-Clang-CUDA.cmake16
-rw-r--r--Modules/Platform/Windows-Clang.cmake7
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx6
-rw-r--r--Source/CTest/cmCTestLaunch.cxx9
-rw-r--r--Source/cmExecuteProcessCommand.cxx13
-rw-r--r--Source/cmPolicies.h9
-rw-r--r--Source/cmSystemTools.cxx12
-rw-r--r--Source/cmTarget.cxx194
-rw-r--r--Source/cmUVProcessChain.cxx19
-rw-r--r--Source/cmUVProcessChain.h6
-rw-r--r--Source/cmake.cxx7
-rw-r--r--Source/cmcmd.cxx9
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx5
-rw-r--r--Tests/CMakeLib/testUVProcessChainHelper.cxx4
-rw-r--r--Tests/Cuda/CMakeLists.txt6
-rw-r--r--Tests/CudaOnly/CMakeLists.txt4
-rw-r--r--Tests/MSVCDebugInformationFormat/override-CUDA.cmake1
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt1
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt233
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-NEW.cmake4
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt1
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt104
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-OLD.cmake4
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt1
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt297
-rw-r--r--Tests/RunCMake/CMP0160/CMP0160-WARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0160/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake52
-rw-r--r--Tests/RunCMake/CMP0160/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Common.cmake2
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake3
-rw-r--r--Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt2
-rw-r--r--Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt4
-rw-r--r--Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt2
-rw-r--r--Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt6
-rw-r--r--Tests/RunCMake/Swift/RunCMakeTest.cmake42
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt4
-rw-r--r--Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt2
-rw-r--r--Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt2
-rw-r--r--Tests/SwiftMix/CMakeLists.txt5
-rw-r--r--Tests/SwiftMixLib/CMakeLists.txt3
-rw-r--r--Tests/SwiftOnly/SubA/SubA.swift1
-rw-r--r--Tests/SwiftOnly/SubB/SubB.swift2
-rw-r--r--Utilities/Release/WiX/WIX.template.in1
59 files changed, 1044 insertions, 299 deletions
diff --git a/Auxiliary/cmake-mode.el b/Auxiliary/cmake-mode.el
index 6bd23bf..b5e5ff4 100644
--- a/Auxiliary/cmake-mode.el
+++ b/Auxiliary/cmake-mode.el
@@ -258,15 +258,6 @@ Return t unless search stops due to end of buffer."
(forward-line)
t)))
-(defun cmake-mark-defun ()
- "Mark the current CMake function or macro.
-
-This puts the mark at the end, and point at the beginning."
- (interactive)
- (cmake-end-of-defun)
- (push-mark nil :nomsg :activate)
- (cmake-beginning-of-defun))
-
;------------------------------------------------------------------------------
@@ -346,6 +337,10 @@ This puts the mark at the end, and point at the beginning."
(define-derived-mode cmake-mode prog-mode "CMake"
"Major mode for editing CMake source files."
+ ;; Setup jumping to beginning/end of a CMake function/macro.
+ (set (make-local-variable 'beginning-of-defun-function) #'cmake-beginning-of-defun)
+ (set (make-local-variable 'end-of-defun-function) #'cmake-end-of-defun)
+
; Setup font-lock mode.
(set (make-local-variable 'font-lock-defaults) '(cmake-font-lock-keywords))
; Setup indentation function.
@@ -356,11 +351,6 @@ This puts the mark at the end, and point at the beginning."
(set (make-local-variable 'syntax-propertize-function) cmake--syntax-propertize-function)
(add-hook 'syntax-propertize-extend-region-functions #'syntax-propertize-multiline nil t))
-;; Default cmake-mode key bindings
-(define-key cmake-mode-map "\e\C-a" #'cmake-beginning-of-defun)
-(define-key cmake-mode-map "\e\C-e" #'cmake-end-of-defun)
-(define-key cmake-mode-map "\e\C-h" #'cmake-mark-defun)
-
; Help mode starts here
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 2bb4f2f..d37c855 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.29
.. toctree::
:maxdepth: 1
+ CMP0160: More read-only target properties now error when trying to set them. </policy/CMP0160>
CMP0159: file(STRINGS) with REGEX updates CMAKE_MATCH_<n>. </policy/CMP0159>
CMP0158: add_test() honors CMAKE_CROSSCOMPILING_EMULATOR only when cross-compiling. </policy/CMP0158>
CMP0157: Swift compilation mode is selected by an abstraction. </policy/CMP0157>
diff --git a/Help/policy/CMP0160.rst b/Help/policy/CMP0160.rst
new file mode 100644
index 0000000..46318ab
--- /dev/null
+++ b/Help/policy/CMP0160.rst
@@ -0,0 +1,39 @@
+CMP0160
+-------
+
+.. versionadded:: 3.29
+
+More read-only target properties now error when trying to set them.
+
+The :command:`set_target_properties` and :command:`set_property` commands
+are intended to error out on all read-only properties. However, CMake 3.28 and
+below only did this for the following properties:
+
+* :prop_tgt:`HEADER_SETS`
+* :prop_tgt:`INTERFACE_HEADER_SETS`
+* :prop_tgt:`IMPORTED_GLOBAL`
+* :prop_tgt:`MANUALLY_ADDED_DEPENDENCIES`
+* :prop_tgt:`NAME`
+* :prop_tgt:`TYPE`
+
+This policy enforces the read-only nature of the following target properties:
+
+* :prop_tgt:`ALIAS_GLOBAL`
+* :prop_tgt:`BINARY_DIR`
+* :prop_tgt:`CXX_MODULE_SETS`
+* :prop_tgt:`IMPORTED`
+* :prop_tgt:`INTERFACE_CXX_MODULE_SETS`
+* :prop_tgt:`LOCATION`
+* :prop_tgt:`LOCATION_<CONFIG>`
+* :prop_tgt:`SOURCE_DIR`
+
+The ``OLD`` behavior for this policy is to only error out for the properties
+:prop_tgt:`MANUALLY_ADDED_DEPENDENCIES`, :prop_tgt:`NAME`, and :prop_tgt:`TYPE`.
+The ``NEW`` behavior for this policy is to error out on all target properties
+that are documented as read-only.
+
+.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
+.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
+.. include:: STANDARD_ADVICE.txt
+
+.. include:: DEPRECATED.txt
diff --git a/Help/release/dev/IntelLLVM-isystem-flag.rst b/Help/release/dev/IntelLLVM-isystem-flag.rst
new file mode 100644
index 0000000..bba3d26
--- /dev/null
+++ b/Help/release/dev/IntelLLVM-isystem-flag.rst
@@ -0,0 +1,6 @@
+IntelLLVM-isystem-flag
+----------------------
+
+* The :generator:`Ninja` and :generator:`NMake Makefiles` generators now use
+ the ``-external:I`` flag for system includes when using IntelLLVM as of
+ version 2021.4. The ``-external:W0`` flag is also used as of version 2022.2.
diff --git a/Help/release/dev/cuda-clang-windows.rst b/Help/release/dev/cuda-clang-windows.rst
new file mode 100644
index 0000000..082fe2f
--- /dev/null
+++ b/Help/release/dev/cuda-clang-windows.rst
@@ -0,0 +1,5 @@
+cuda-clang-windows
+------------------
+
+* The ``CUDA`` language can now be compiled with Clang on Windows
+ using its GNU-like frontend, ``clang++``.
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 6ac4dad..70528da 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -74,10 +74,6 @@ if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
set(CMAKE_CUDA_COMPILER_ID_VENDOR_REGEX_Clang "(clang version)")
CMAKE_DETERMINE_COMPILER_ID_VENDOR(CUDA "--version")
- if(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang" AND WIN32)
- message(FATAL_ERROR "Clang with CUDA is not yet supported on Windows. See CMake issue #20776.")
- endif()
-
# Find the CUDA toolkit to get:
# - CMAKE_CUDA_COMPILER_TOOLKIT_VERSION
# - CMAKE_CUDA_COMPILER_TOOLKIT_ROOT
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index 4c033ca..4f8a9b7 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -17,6 +17,7 @@ set(__pch_header_OBJCXX "objective-c++-header")
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
+ OR "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC")
macro(__compiler_clang lang)
endmacro()
diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake
index f3c0bf4..a58128a 100644
--- a/Modules/Compiler/IntelLLVM.cmake
+++ b/Modules/Compiler/IntelLLVM.cmake
@@ -36,6 +36,12 @@ if(CMAKE_HOST_WIN32)
__compiler_intel_llvm_common(${lang})
set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-Qipo")
set(CMAKE_${lang}_LINK_OPTIONS_IPO "-Qipo")
+ if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "2021.4")
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-external:I")
+ if (CMAKE_${lang}_COMPILER_VERSION VERSION_GREATER_EQUAL "2022.2")
+ set(_CMAKE_INCLUDE_SYSTEM_FLAG_${lang}_WARNING "-external:W0 ")
+ endif ()
+ endif ()
endmacro()
else()
# GNU-like
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 7352769..82885cb 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -65,104 +65,6 @@ directory of a Freetype installation.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
-set(_Freetype_args)
-if (Freetype_FIND_VERSION)
- list(APPEND _Freetype_args
- "${Freetype_FIND_VERSION}")
- if (Freetype_FIND_VERSION_EXACT)
- list(APPEND _Freetype_args
- EXACT)
- endif ()
-endif ()
-set(_Freetype_component_req)
-set(_Freetype_component_opt)
-foreach (_Freetype_component IN LISTS Freetype_FIND_COMPONENTS)
- if (Freetype_FIND_REQUIRE_${_Freetype_component})
- list(APPEND _Freetype_component_req
- "${_Freetype_component}")
- else ()
- list(APPEND _Freetype_component_opt
- "${_Freetype_component}")
- endif ()
-endforeach ()
-unset(_Freetype_component)
-if (_Freetype_component_req)
- list(APPEND _Freetype_args
- COMPONENTS "${_Freetype_component_req}")
-endif ()
-unset(_Freetype_component_req)
-if (_Freetype_component_opt)
- list(APPEND _Freetype_args
- OPTIONAL_COMPONENTS "${_Freetype_component_opt}")
-endif ()
-unset(_Freetype_component_opt)
-# Always find with QUIET to avoid noise when it is not found.
-find_package(freetype CONFIG QUIET ${_Freetype_args})
-unset(_Freetype_args)
-if (freetype_FOUND)
- if (NOT TARGET Freetype::Freetype)
- add_library(Freetype::Freetype IMPORTED INTERFACE)
- set_target_properties(Freetype::Freetype PROPERTIES
- INTERFACE_LINK_LIBRARIES freetype)
- endif ()
- get_property(FREETYPE_INCLUDE_DIRS TARGET freetype PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
- get_property(FREETYPE_LIBRARIES TARGET freetype PROPERTY INTERFACE_LINK_LIBRARIES)
- get_property(_Freetype_location TARGET freetype PROPERTY IMPORTED_IMPLIB)
- if (NOT _Freetype_location)
- get_property(_Freetype_location_release TARGET freetype PROPERTY IMPORTED_IMPLIB_RELEASE)
- if (NOT _Freetype_location_release)
- get_property(_Freetype_location_release TARGET freetype PROPERTY IMPORTED_IMPLIB_RELWITHDEBINFO)
- endif ()
- get_property(_Freetype_location_debug TARGET freetype PROPERTY IMPORTED_IMPLIB_DEBUG)
- if (_Freetype_location_release AND _Freetype_location_debug)
- set(_Freetype_location
- optimized "${_Freetype_location_release}"
- debug "${_Freetype_location_debug}")
- elseif (_Freetype_location_release)
- set(_Freetype_location "${_Freetype_location_release}")
- elseif (_Freetype_location_debug)
- set(_Freetype_location "${_Freetype_location_debug}")
- else ()
- get_property(_Freetype_location_release TARGET freetype PROPERTY LOCATION_RELEASE)
- if (NOT _Freetype_location_release)
- get_property(_Freetype_location_release TARGET freetype PROPERTY LOCATION_RELWITHDEBINFO)
- endif ()
- get_property(_Freetype_location_debug TARGET freetype PROPERTY LOCATION_DEBUG)
- if (_Freetype_location_release AND _Freetype_location_debug)
- set(_Freetype_location
- optimized "${_Freetype_location_release}"
- debug "${_Freetype_location_debug}")
- elseif (_Freetype_location_release)
- set(_Freetype_location "${_Freetype_location_release}")
- elseif (_Freetype_location_debug)
- set(_Freetype_location "${_Freetype_location_debug}")
- else ()
- get_property(_Freetype_location TARGET freetype PROPERTY LOCATION)
- endif ()
- endif ()
- unset(_Freetype_location_release)
- unset(_Freetype_location_debug)
- endif ()
- list(INSERT FREETYPE_LIBRARIES 0
- "${_Freetype_location}")
- unset(_Freetype_location)
- set(Freetype_FOUND 1)
- set(FREETYPE_FOUND 1)
- set(FREETYPE_VERSION_STRING "${freetype_VERSION}")
- foreach (_Freetype_component IN LISTS Freetype_FIND_COMPONENTS)
- set(Freetype_${_Freetype_component}_FOUND "${freetype_${_Freetype_component}_FOUND}")
- endforeach ()
- unset(_Freetype_component)
-
- include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
- find_package_handle_standard_args(Freetype
- HANDLE_COMPONENTS
- VERSION_VAR FREETYPE_VERSION_STRING
- )
-
- return ()
-endif ()
-
set(FREETYPE_FIND_ARGS
HINTS
ENV FREETYPE_DIR
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 04a21bc..608b2ed 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -189,17 +189,13 @@ Cached variables
the location of the root of the Matlab installation found. If this value
is changed by the user, the result variables are recomputed.
-Provided macros
-^^^^^^^^^^^^^^^
+Provided commands
+^^^^^^^^^^^^^^^^^
:command:`matlab_get_version_from_release_name`
- returns the version from the release name
+ returns the version from the Matlab release name
:command:`matlab_get_release_name_from_version`
returns the release name from the Matlab version
-
-Provided functions
-^^^^^^^^^^^^^^^^^^
-
:command:`matlab_add_mex`
adds a target compiling a MEX file.
:command:`matlab_add_unit_test`
@@ -350,6 +346,11 @@ file(MAKE_DIRECTORY "${_matlab_temporary_folder}")
* Output: ``version`` is the version of Matlab (e.g. 23.2.0)
Returns the version of Matlab from a release name
+
+ .. note::
+
+ This command provides correct versions mappings for Matlab but not MCR.
+
#]=======================================================================]
macro(matlab_get_version_from_release_name release_name version_name)
@@ -377,6 +378,11 @@ endmacro()
* Output: ``release_name`` is the release name (R2023b)
Returns the release name from the version of Matlab
+
+ .. note::
+
+ This command provides correct version mappings for Matlab but not MCR.
+
#]=======================================================================]
function(matlab_get_release_name_from_version version release_name)
@@ -442,9 +448,10 @@ endmacro()
are installed. The found versions are returned in `matlab_versions`.
Set `win64` to `TRUE` if the 64 bit version of Matlab should be looked for
The returned list contains all versions under
- ``HKLM\\SOFTWARE\\Mathworks\\MATLAB`` and
- ``HKLM\\SOFTWARE\\Mathworks\\MATLAB Runtime`` or an empty list in case an
- error occurred (or nothing found).
+ ``HKLM\\SOFTWARE\\Mathworks\\MATLAB``,
+ ``HKLM\\SOFTWARE\\Mathworks\\MATLAB Runtime`` and
+ ``HKLM\\SOFTWARE\\Mathworks\\MATLAB Compiler Runtime`` or an empty list in
+ case an error occurred (or nothing found).
.. note::
@@ -455,7 +462,7 @@ endmacro()
function(matlab_extract_all_installed_versions_from_registry win64 matlab_versions)
if(NOT CMAKE_HOST_WIN32)
- message(FATAL_ERROR "[MATLAB] This macro can only be called by a Windows host")
+ message(FATAL_ERROR "[MATLAB] This function can only be called by a Windows host")
endif()
if(${win64} AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "64")
@@ -474,10 +481,10 @@ function(matlab_extract_all_installed_versions_from_registry win64 matlab_versio
)
if(_reg)
- string(REGEX MATCHALL "([0-9]+\\.[0-9]+)" _versions_regex "${_reg}")
+ string(REGEX MATCHALL "([0-9]+(\\.[0-9]+)+)" _versions_regex "${_reg}")
foreach(_match IN LISTS _versions_regex)
- if(_match MATCHES "([0-9]+\\.[0-9]+)")
+ 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"
@@ -545,8 +552,9 @@ function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_
# extract_matlab_versions_from_registry_brute_force or
# matlab_extract_all_installed_versions_from_registry.
- # only the major.minor version is used in Mathworks Windows Registry keys
- list(TRANSFORM matlab_versions REPLACE "^([0-9]+\\.[0-9]+).*" "\\1")
+ # Mostly the major.minor version is used in Mathworks Windows Registry keys.
+ # If the patch is not zero, major.minor.patch is used.
+ list(TRANSFORM matlab_versions REPLACE "^([0-9]+\\.[0-9]+(\\.[1-9][0-9]*)?).*" "\\1")
set(_matlab_roots_list )
# check for Matlab installations
diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake
index 85c0a93..5766045 100644
--- a/Modules/Internal/CPack/CPackRPM.cmake
+++ b/Modules/Internal/CPack/CPackRPM.cmake
@@ -1041,7 +1041,11 @@ function(cpack_rpm_generate_package)
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
- set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
+ if(CPACK_THREADS GREATER "0")
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7T${CPACK_THREADS}.xzdio")
+ else()
+ set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7T.xzdio")
+ endif()
endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
diff --git a/Modules/Internal/CPack/WIX.template.in b/Modules/Internal/CPack/WIX.template.in
index fdd8278..95ba7fa 100644
--- a/Modules/Internal/CPack/WIX.template.in
+++ b/Modules/Internal/CPack/WIX.template.in
@@ -45,6 +45,7 @@
<FeatureRef Id="ProductFeature"/>
<UIRef Id="$(var.CPACK_WIX_UI_REF)" />
+ <UIRef Id="WixUI_ErrorProgressText" />
<?include "properties.wxi"?>
<?include "product_fragment.wxi"?>
diff --git a/Modules/Platform/Windows-Clang-CUDA.cmake b/Modules/Platform/Windows-Clang-CUDA.cmake
new file mode 100644
index 0000000..c37df3b
--- /dev/null
+++ b/Modules/Platform/Windows-Clang-CUDA.cmake
@@ -0,0 +1,16 @@
+include(Platform/Windows-Clang)
+__windows_compiler_clang(CUDA)
+
+# Tell Clang where to find the CUDA libraries.
+set(__IMPLICIT_LINKS)
+foreach(dir ${CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES})
+ string(APPEND __IMPLICIT_LINKS " -L\"${dir}\"")
+endforeach()
+string(APPEND CMAKE_CUDA_LINK_EXECUTABLE "${__IMPLICIT_LINKS}")
+string(APPEND CMAKE_CUDA_CREATE_SHARED_LIBRARY "${__IMPLICIT_LINKS}")
+string(APPEND CMAKE_CUDA_CREATE_SHARED_MODULE "${__IMPLICIT_LINKS}")
+unset(__IMPLICIT_LINKS)
+
+# Device linking is just regular linking so these are the same.
+set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG ${CMAKE_CUDA_LINKER_WRAPPER_FLAG})
+set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG_SEP ${CMAKE_CUDA_LINKER_WRAPPER_FLAG_SEP})
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index f081f42..db48150 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -53,6 +53,7 @@ macro(__windows_compiler_clang_gnu lang)
set(CMAKE_${lang}_LINK_OPTIONS_PIE "")
set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "")
+ set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
set(CMAKE_${lang}_LINK_LIBRARIES_PROCESSING ORDER=FORWARD UNICITY=ALL)
@@ -184,18 +185,19 @@ endmacro()
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
+ OR "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_HIP_SIMULATE_ID}" STREQUAL "xMSVC")
__verify_same_language_values(COMPILER_ID
"The current configuration mixes Clang and MSVC or "
"some other CL compatible compiler tool. This is not supported. "
- "Use either clang or MSVC as both C, C++ and/or HIP compilers.")
+ "Use either Clang or MSVC as the compiler for all of C, C++, CUDA and/or HIP.")
__verify_same_language_values(COMPILER_FRONTEND_VARIANT
"The current configuration uses the Clang compiler "
"tool with mixed frontend variants, both the GNU and in MSVC CL "
"like variants. This is not supported. Use either clang/clang++ "
- "or clang-cl as both C, C++ and/or HIP compilers.")
+ "or clang-cl as all C, C++, CUDA and/or HIP compilers.")
if(NOT CMAKE_RC_COMPILER_INIT)
# Check if rc is already in the path
@@ -217,6 +219,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"
OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"
+ OR "x${CMAKE_CUDA_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"
OR "x${CMAKE_HIP_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
include(Platform/Windows-MSVC)
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 0db3d9d..165e09c 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 28)
-set(CMake_VERSION_PATCH 20240122)
+set(CMake_VERSION_PATCH 20240126)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 1aa49cf..f9f9add 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -21,8 +21,6 @@
#include "cmsys/Glob.hxx"
#include "cmsys/RegularExpression.hxx"
-#include "cm_fileno.hxx"
-
#include "cmCTest.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
@@ -1887,9 +1885,9 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
cmsys::SystemTools::Fopen(stderrFile, "w"), fclose);
builder.AddCommand(args)
.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
- cm_fileno(stdoutHandle.get()))
+ stdoutHandle.get())
.SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
- cm_fileno(stderrHandle.get()));
+ stderrHandle.get());
// since we set the output file names wait for it to end
auto chain = builder.Start();
chain.Wait();
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 6b13ad1..9669d76 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -13,8 +13,6 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
-#include "cm_fileno.hxx"
-
#include "cmCTestLaunchReporter.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
@@ -158,11 +156,8 @@ void cmCTestLaunch::RunChild()
cmsys::ofstream ferr;
if (this->Reporter.Passthru) {
// In passthru mode we just share the output pipes.
- builder
- .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
- cm_fileno(stdout))
- .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
- cm_fileno(stderr));
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, stdout)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, stderr);
} else {
// In full mode we record the child output pipes to log files.
builder.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index da6def9..2b923df 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -17,8 +17,6 @@
#include <cm3p/uv.h>
-#include "cm_fileno.hxx"
-
#include "cmArgumentParser.h"
#include "cmExecutionStatus.h"
#include "cmList.h"
@@ -183,11 +181,10 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
inputFile.reset(cmsys::SystemTools::Fopen(inputFilename, "rb"));
if (inputFile) {
builder.SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT,
- cm_fileno(inputFile.get()));
+ inputFile.get());
}
} else {
- builder.SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT,
- cm_fileno(stdin));
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, stdin);
}
std::unique_ptr<FILE, int (*)(FILE*)> outputFile(nullptr, fclose);
@@ -195,7 +192,7 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
outputFile.reset(cmsys::SystemTools::Fopen(outputFilename, "wb"));
if (outputFile) {
builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
- cm_fileno(outputFile.get()));
+ outputFile.get());
}
} else {
if (arguments.OutputVariable == arguments.ErrorVariable &&
@@ -211,13 +208,13 @@ bool cmExecuteProcessCommand(std::vector<std::string> const& args,
if (errorFilename == outputFilename) {
if (outputFile) {
builder.SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
- cm_fileno(outputFile.get()));
+ outputFile.get());
}
} else {
errorFile.reset(cmsys::SystemTools::Fopen(errorFilename, "wb"));
if (errorFile) {
builder.SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
- cm_fileno(errorFile.get()));
+ errorFile.get());
}
}
} else if (arguments.ErrorVariable.empty() ||
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 65870dc..e23e687 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -487,7 +487,11 @@ class cmMakefile;
3, 29, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0159, \
"file(STRINGS) with REGEX updates CMAKE_MATCH_<n>.", 3, 29, 0, \
- cmPolicies::WARN)
+ cmPolicies::WARN) \
+ SELECT( \
+ POLICY, CMP0160, \
+ "More read-only target properties now error when trying to set them.", 3, \
+ 29, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \
@@ -529,7 +533,8 @@ class cmMakefile;
F(CMP0154) \
F(CMP0155) \
F(CMP0156) \
- F(CMP0157)
+ F(CMP0157) \
+ F(CMP0160)
#define CM_FOR_EACH_CUSTOM_COMMAND_POLICY(F) \
F(CMP0116) \
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index fca8186..bd914e5 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -25,8 +25,6 @@
#include <cm3p/uv.h>
-#include "cm_fileno.hxx"
-
#include "cmDuration.h"
#include "cmELF.h"
#include "cmMessageMetadata.h"
@@ -576,8 +574,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
cmDuration timeout, Encoding encoding)
{
cmUVProcessChainBuilder builder;
- builder
- .SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, cm_fileno(stdin))
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, stdin)
.AddCommand(command);
if (dir) {
builder.SetWorkingDirectory(dir);
@@ -586,11 +583,8 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
if (outputflag == OUTPUT_PASSTHROUGH) {
captureStdOut = nullptr;
captureStdErr = nullptr;
- builder
- .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
- cm_fileno(stdout))
- .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
- cm_fileno(stderr));
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, stdout)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, stderr);
} else if (outputflag == OUTPUT_MERGE ||
(captureStdErr && captureStdErr == captureStdOut)) {
builder.SetMergedBuiltinStreams();
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 4cb9a54..e6e1ac4 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -8,6 +8,7 @@
#include <map>
#include <set>
#include <sstream>
+#include <unordered_map>
#include <unordered_set>
#include <cm/memory>
@@ -802,18 +803,6 @@ bool FileSetType::WriteProperties(cmTarget* tgt, cmTargetInternals* impl,
}
return true;
}
- if (prop == this->SelfEntries.PropertyName) {
- impl->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- cmStrCat(this->SelfEntries.PropertyName, " property is read-only\n"));
- return true;
- }
- if (prop == this->InterfaceEntries.PropertyName) {
- impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- cmStrCat(this->InterfaceEntries.PropertyName,
- " property is read-only\n"));
- return true;
- }
return false;
}
@@ -1981,7 +1970,6 @@ MAKE_PROP(CUDA_CUBIN_COMPILATION);
MAKE_PROP(CUDA_FATBIN_COMPILATION);
MAKE_PROP(CUDA_OPTIX_COMPILATION);
MAKE_PROP(CUDA_PTX_COMPILATION);
-MAKE_PROP(EXPORT_NAME);
MAKE_PROP(IMPORTED);
MAKE_PROP(IMPORTED_GLOBAL);
MAKE_PROP(INCLUDE_DIRECTORIES);
@@ -2007,43 +1995,118 @@ MAKE_PROP(INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE);
#undef MAKE_PROP
}
-void cmTarget::SetProperty(const std::string& prop, cmValue value)
+namespace {
+
+enum class ReadOnlyCondition
{
- if (prop == propMANUALLY_ADDED_DEPENDENCIES) {
- this->impl->Makefile->IssueMessage(
- MessageType::FATAL_ERROR,
- "MANUALLY_ADDED_DEPENDENCIES property is read-only\n");
- return;
- }
- if (prop == propNAME) {
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- "NAME property is read-only\n");
- return;
- }
- if (prop == propTYPE) {
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- "TYPE property is read-only\n");
- return;
+ All,
+ Imported,
+ NonImported,
+};
+
+struct ReadOnlyProperty
+{
+ ReadOnlyProperty(ReadOnlyCondition cond)
+ : Condition{ cond }
+ , Policy{} {};
+ ReadOnlyProperty(ReadOnlyCondition cond, cmPolicies::PolicyID id)
+ : Condition{ cond }
+ , Policy{ id } {};
+
+ ReadOnlyCondition Condition;
+ cm::optional<cmPolicies::PolicyID> Policy;
+
+ std::string message(const std::string& prop, cmTarget* target) const
+ {
+ std::string msg;
+ if (this->Condition == ReadOnlyCondition::All) {
+ msg = " property is read-only for target(\"";
+ } else if (this->Condition == ReadOnlyCondition::Imported) {
+ msg = " property can't be set on imported targets(\"";
+ } else if (this->Condition == ReadOnlyCondition::NonImported) {
+ msg = " property can't be set on non-imported targets(\"";
+ }
+ return cmStrCat(prop, msg, target->GetName(), "\")\n");
}
- if (prop == propEXPORT_NAME && this->IsImported()) {
- std::ostringstream e;
- e << "EXPORT_NAME property can't be set on imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
+
+ bool isReadOnly(const std::string& prop, cmMakefile* context,
+ cmTarget* target) const
+ {
+ auto importedTarget = target->IsImported();
+ bool matchingCondition = true;
+ if ((!importedTarget && this->Condition == ReadOnlyCondition::Imported) ||
+ (importedTarget &&
+ this->Condition == ReadOnlyCondition::NonImported)) {
+ matchingCondition = false;
+ }
+ if (!matchingCondition) {
+ // Not read-only in this scenario
+ return false;
+ }
+
+ bool readOnly = true;
+ if (!this->Policy) {
+ // No policy associated, so is always read-only
+ context->IssueMessage(MessageType::FATAL_ERROR,
+ this->message(prop, target));
+ } else {
+ switch (target->GetPolicyStatus(*this->Policy)) {
+ case cmPolicies::WARN:
+ context->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0160) + "\n" +
+ this->message(prop, target));
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ readOnly = false;
+ break;
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::NEW:
+ context->IssueMessage(MessageType::FATAL_ERROR,
+ this->message(prop, target));
+ break;
+ }
+ }
+ return readOnly;
}
- if (prop == propSOURCES && this->IsImported()) {
- std::ostringstream e;
- e << "SOURCES property can't be set on imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
+};
+
+bool IsSetableProperty(cmMakefile* context, cmTarget* target,
+ const std::string& prop)
+{
+ using ROC = ReadOnlyCondition;
+ static std::unordered_map<std::string, ReadOnlyProperty> const readOnlyProps{
+ { "EXPORT_NAME", { ROC::Imported } },
+ { "HEADER_SETS", { ROC::All } },
+ { "IMPORTED_GLOBAL", { ROC::NonImported } },
+ { "INTERFACE_HEADER_SETS", { ROC::All } },
+ { "MANUALLY_ADDED_DEPENDENCIES", { ROC::All } },
+ { "NAME", { ROC::All } },
+ { "SOURCES", { ROC::Imported } },
+ { "TYPE", { ROC::All } },
+ { "ALIAS_GLOBAL", { ROC::All, cmPolicies::CMP0160 } },
+ { "BINARY_DIR", { ROC::All, cmPolicies::CMP0160 } },
+ { "CXX_MODULE_SETS", { ROC::All, cmPolicies::CMP0160 } },
+ { "IMPORTED", { ROC::All, cmPolicies::CMP0160 } },
+ { "INTERFACE_CXX_MODULE_SETS", { ROC::All, cmPolicies::CMP0160 } },
+ { "LOCATION", { ROC::All, cmPolicies::CMP0160 } },
+ { "LOCATION_CONFIG", { ROC::All, cmPolicies::CMP0160 } },
+ { "SOURCE_DIR", { ROC::All, cmPolicies::CMP0160 } }
+ };
+
+ auto it = readOnlyProps.find(prop);
+
+ if (it != readOnlyProps.end()) {
+ return !(it->second.isReadOnly(prop, context, target));
}
- if (prop == propIMPORTED_GLOBAL && !this->IsImported()) {
- std::ostringstream e;
- e << "IMPORTED_GLOBAL property can't be set on non-imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ return true;
+}
+}
+
+void cmTarget::SetProperty(const std::string& prop, cmValue value)
+{
+ if (!IsSetableProperty(this->impl->Makefile, this, prop)) {
return;
}
@@ -2188,40 +2251,23 @@ void cmTarget::AppendProperty(const std::string& prop,
cm::optional<cmListFileBacktrace> const& bt,
bool asString)
{
- if (prop == "NAME") {
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR,
- "NAME property is read-only\n");
- return;
- }
- if (prop == "EXPORT_NAME" && this->IsImported()) {
- std::ostringstream e;
- e << "EXPORT_NAME property can't be set on imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
- }
- if (prop == "SOURCES" && this->IsImported()) {
- std::ostringstream e;
- e << "SOURCES property can't be set on imported targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ if (!IsSetableProperty(this->impl->Makefile, this, prop)) {
return;
}
if (prop == "IMPORTED_GLOBAL") {
- std::ostringstream e;
- e << "IMPORTED_GLOBAL property can't be appended, only set on imported "
- "targets (\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
- return;
+ this->impl->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat("IMPORTED_GLOBAL property can't be appended, only set on "
+ "imported targets (\"",
+ this->impl->Name, "\")\n"));
}
if (prop == propPRECOMPILE_HEADERS &&
this->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM")) {
- std::ostringstream e;
- e << "PRECOMPILE_HEADERS_REUSE_FROM property is already set on target "
- "(\""
- << this->impl->Name << "\")\n";
- this->impl->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ this->impl->Makefile->IssueMessage(
+ MessageType::FATAL_ERROR,
+ cmStrCat(
+ "PRECOMPILE_HEADERS_REUSE_FROM property is already set on target (\"",
+ this->impl->Name, "\")\n"));
return;
}
diff --git a/Source/cmUVProcessChain.cxx b/Source/cmUVProcessChain.cxx
index 4c72261..0412f45 100644
--- a/Source/cmUVProcessChain.cxx
+++ b/Source/cmUVProcessChain.cxx
@@ -12,6 +12,8 @@
#include <cm3p/uv.h>
+#include "cm_fileno.hxx"
+
#include "cmGetPipes.h"
#include "cmUVHandlePtr.h"
@@ -58,12 +60,7 @@ struct cmUVProcessChain::InternalData
void Finish();
};
-cmUVProcessChainBuilder::cmUVProcessChainBuilder()
-{
- this->SetNoStream(Stream_INPUT)
- .SetNoStream(Stream_OUTPUT)
- .SetNoStream(Stream_ERROR);
-}
+cmUVProcessChainBuilder::cmUVProcessChainBuilder() = default;
cmUVProcessChainBuilder& cmUVProcessChainBuilder::AddCommand(
const std::vector<std::string>& arguments)
@@ -136,6 +133,16 @@ cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetExternalStream(
return *this;
}
+cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetExternalStream(
+ Stream stdio, FILE* stream)
+{
+ int fd = cm_fileno(stream);
+ if (fd >= 0) {
+ return this->SetExternalStream(stdio, fd);
+ }
+ return this->SetNoStream(stdio);
+}
+
cmUVProcessChainBuilder& cmUVProcessChainBuilder::SetMergedBuiltinStreams()
{
this->MergedBuiltinStreams = true;
diff --git a/Source/cmUVProcessChain.h b/Source/cmUVProcessChain.h
index 139588b..65816e2 100644
--- a/Source/cmUVProcessChain.h
+++ b/Source/cmUVProcessChain.h
@@ -7,6 +7,7 @@
#include <array>
#include <cstddef> // IWYU pragma: keep
#include <cstdint>
+#include <cstdio>
#include <memory>
#include <string>
#include <utility>
@@ -36,6 +37,7 @@ public:
cmUVProcessChainBuilder& SetBuiltinStream(Stream stdio);
cmUVProcessChainBuilder& SetMergedBuiltinStreams();
cmUVProcessChainBuilder& SetExternalStream(Stream stdio, int fd);
+ cmUVProcessChainBuilder& SetExternalStream(Stream stdio, FILE* stream);
cmUVProcessChainBuilder& SetWorkingDirectory(std::string dir);
uv_loop_t* GetLoop() const;
@@ -54,8 +56,8 @@ private:
struct StdioConfiguration
{
- StdioType Type;
- int FileDescriptor;
+ StdioType Type = None;
+ int FileDescriptor = -1;
};
struct ProcessConfiguration
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 7ab7600..88fac8d 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -27,7 +27,6 @@
#include "cmsys/Glob.hxx"
#include "cmsys/RegularExpression.hxx"
-#include "cm_fileno.hxx"
#include "cm_sys_stat.h"
#include "cmBuildOptions.h"
@@ -3934,10 +3933,8 @@ std::function<int()> cmake::BuildWorkflowStep(
{
cmUVProcessChainBuilder builder;
builder.AddCommand(args)
- .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
- cm_fileno(stdout))
- .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
- cm_fileno(stderr));
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, stdout)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, stderr);
return [builder]() -> int {
auto chain = builder.Start();
chain.Wait();
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index bcf7462..25b2ced 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -11,8 +11,6 @@
#include <cm3p/uv.h>
#include <fcntl.h>
-#include "cm_fileno.hxx"
-
#include "cmCommandLineArgument.h"
#include "cmConsoleBuf.h"
#include "cmCryptoHash.h"
@@ -1917,11 +1915,8 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string> const& args)
cmUVProcessChainBuilder builder;
// Children should share stdout and stderr with this process.
- builder
- .SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT,
- cm_fileno(stdout))
- .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR,
- cm_fileno(stderr));
+ builder.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, stdout)
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, stderr);
// Setup this command line.
std::vector<std::string> args2;
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index 6014889..b669f65 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -12,8 +12,6 @@
#include <cm3p/uv.h>
-#include "cm_fileno.hxx"
-
#include "cmGetPipes.h"
#include "cmStringAlgorithms.h"
#include "cmUVHandlePtr.h"
@@ -641,8 +639,7 @@ bool testUVProcessChainInputFile(const char* helperCommand)
cmUVProcessChainBuilder builder;
builder.AddCommand({ helperCommand, "dedup" })
- .SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT,
- cm_fileno(f.get()))
+ .SetExternalStream(cmUVProcessChainBuilder::Stream_INPUT, f.get())
.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT);
auto chain = builder.Start();
diff --git a/Tests/CMakeLib/testUVProcessChainHelper.cxx b/Tests/CMakeLib/testUVProcessChainHelper.cxx
index b53cac4..1b4adb7 100644
--- a/Tests/CMakeLib/testUVProcessChainHelper.cxx
+++ b/Tests/CMakeLib/testUVProcessChainHelper.cxx
@@ -9,6 +9,10 @@
#include "cmSystemTools.h"
+#ifdef _WIN32
+# include <windows.h>
+#endif
+
static std::string getStdin()
{
char buffer[1024];
diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt
index efe0358..04ef86d 100644
--- a/Tests/Cuda/CMakeLists.txt
+++ b/Tests/Cuda/CMakeLists.txt
@@ -9,8 +9,10 @@ add_cuda_test_macro(Cuda.ObjectLibrary CudaObjectLibrary)
add_cuda_test_macro(Cuda.MixedStandardLevels1 MixedStandardLevels1)
add_cuda_test_macro(Cuda.MixedStandardLevels2 MixedStandardLevels2)
add_cuda_test_macro(Cuda.MixedStandardLevels3 MixedStandardLevels3)
-add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4)
-add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5)
+if(NOT WIN32 OR NOT CMake_TEST_CUDA STREQUAL "Clang") # MSVC std lib needs C++14
+ add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4)
+ add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5)
+endif()
add_cuda_test_macro(Cuda.NotEnabled CudaNotEnabled)
add_cuda_test_macro(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
add_cuda_test_macro(Cuda.StubRPATH StubRPATH)
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 9f49498..128d371 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -11,7 +11,9 @@ add_cuda_test_macro(CudaOnly.EnableStandard CudaOnlyEnableStandard)
add_cuda_test_macro(CudaOnly.ExportPTX CudaOnlyExportPTX)
add_cuda_test_macro(CudaOnly.SharedRuntimePlusToolkit CudaOnlySharedRuntimePlusToolkit)
add_cuda_test_macro(CudaOnly.StaticRuntimePlusToolkit CudaOnlyStaticRuntimePlusToolkit)
-add_cuda_test_macro(CudaOnly.Standard98 CudaOnlyStandard98)
+if(NOT WIN32 OR NOT CMake_TEST_CUDA STREQUAL "Clang") # MSVC std lib needs C++14
+ add_cuda_test_macro(CudaOnly.Standard98 CudaOnlyStandard98)
+endif()
set(CudaOnly.Toolkit_BUILD_OPTIONS -DHAS_CUPTI:BOOL=${CMake_TEST_CUDA_CUPTI})
add_cuda_test_macro(CudaOnly.Toolkit CudaOnlyToolkit)
add_cuda_test_macro(CudaOnly.ToolkitBeforeLang CudaOnlyToolkitBeforeLang)
diff --git a/Tests/MSVCDebugInformationFormat/override-CUDA.cmake b/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
index f870775..eaa7bff 100644
--- a/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
+++ b/Tests/MSVCDebugInformationFormat/override-CUDA.cmake
@@ -1,5 +1,6 @@
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_Embedded")
string(REPLACE "-Z7" "-Z7;-DTEST_Z7" "${var}" "${${var}}")
+string(REPLACE "-gcodeview" "-gcodeview;-DTEST_Z7" "${var}" "${${var}}")
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_ProgramDatabase")
string(REPLACE "-Zi" "-Zi;-DTEST_Zi" "${var}" "${${var}}")
set(var "CMAKE_CUDA_COMPILE_OPTIONS_MSVC_DEBUG_INFORMATION_FORMAT_EditAndContinue")
diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt b/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt
new file mode 100644
index 0000000..b52b633
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-NEW-stderr.txt
@@ -0,0 +1,233 @@
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ ALIAS_GLOBAL property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ BINARY_DIR property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ LOCATION property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ LOCATION_CONFIG property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCE_DIR property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED_GLOBAL property can't be set on non-imported
+ targets\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ ALIAS_GLOBAL property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ BINARY_DIR property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ CXX_MODULE_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_CXX_MODULE_SETS property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ LOCATION property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ LOCATION_CONFIG property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCE_DIR property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCES property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-NEW.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake b/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake
new file mode 100644
index 0000000..ed3a256
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-NEW.cmake
@@ -0,0 +1,4 @@
+
+project(ReadOnly LANGUAGES NONE)
+cmake_policy(SET CMP0160 NEW)
+include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt b/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-OLD-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt
new file mode 100644
index 0000000..e57cd9d
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-OLD-stderr.txt
@@ -0,0 +1,104 @@
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED_GLOBAL property can't be set on non-imported
+ targets\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCES property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-OLD.cmake:4 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake b/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake
new file mode 100644
index 0000000..6c6f1f8
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-OLD.cmake
@@ -0,0 +1,4 @@
+
+project(ReadOnly LANGUAGES NONE)
+cmake_policy(SET CMP0160 OLD)
+include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt b/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-WARN-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt b/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt
new file mode 100644
index 0000000..b15104e
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-WARN-stderr.txt
@@ -0,0 +1,297 @@
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ ALIAS_GLOBAL property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ BINARY_DIR property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ IMPORTED property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ INTERFACE_CXX_MODULE_SETS property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ LOCATION property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ LOCATION_CONFIG property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ SOURCE_DIR property is read-only for target\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ IMPORTED_GLOBAL property can't be set on non-imported
+ targets\("ReadOnlyLib"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ INTERFACE_HEADER_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ MANUALLY_ADDED_DEPENDENCIES property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ NAME property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ TYPE property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ ALIAS_GLOBAL property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ BINARY_DIR property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ CXX_MODULE_SETS property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ IMPORTED property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ INTERFACE_CXX_MODULE_SETS property is read-only for
+ target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ LOCATION property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ LOCATION_CONFIG property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ Policy CMP0160 is not set: More read-only target properties now error when
+ trying to set them. Run "cmake --help-policy CMP0160" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ SOURCE_DIR property is read-only for target\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ EXPORT_NAME property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at READONLY_PROPERTIES.cmake:44 \(set_target_properties\):
+ SOURCES property can't be set on imported targets\("ReadOnlyImport"\)
+
+Call Stack \(most recent call first\):
+ CMP0160-WARN.cmake:3 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake b/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake
new file mode 100644
index 0000000..e9e99bb
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMP0160-WARN.cmake
@@ -0,0 +1,3 @@
+
+project(ReadOnly LANGUAGES NONE)
+include(${CMAKE_CURRENT_LIST_DIR}/READONLY_PROPERTIES.cmake)
diff --git a/Tests/RunCMake/CMP0160/CMakeLists.txt b/Tests/RunCMake/CMP0160/CMakeLists.txt
new file mode 100644
index 0000000..6a9ce76
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake b/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake
new file mode 100644
index 0000000..07bbe78
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/READONLY_PROPERTIES.cmake
@@ -0,0 +1,52 @@
+
+set(read_only_properties
+ "HEADER_SETS"
+ "INTERFACE_HEADER_SETS"
+ "MANUALLY_ADDED_DEPENDENCIES"
+ "NAME"
+ "TYPE"
+ )
+set(read_only_properties_imported
+ "EXPORT_NAME"
+ "SOURCES"
+ )
+set(read_only_properties_nonimported
+ "IMPORTED_GLOBAL"
+ )
+set(read_only_properties_160
+ "ALIAS_GLOBAL"
+ "BINARY_DIR"
+ "CXX_MODULE_SETS"
+ "IMPORTED"
+ "INTERFACE_CXX_MODULE_SETS"
+ "LOCATION"
+ "LOCATION_CONFIG"
+ "SOURCE_DIR"
+ )
+
+cmake_policy(GET CMP0160 policy160)
+add_library(ReadOnlyLib )
+add_library(ReadOnlyImport IMPORTED UNKNOWN)
+
+foreach(target ReadOnlyLib ReadOnlyImport)
+ get_target_property(is_imported ${target} IMPORTED)
+ set(are_read_only ${read_only_properties})
+ if(NOT policy160 STREQUAL "OLD")
+ list(APPEND are_read_only ${read_only_properties_160})
+ endif()
+ if(is_imported)
+ list(APPEND are_read_only ${read_only_properties_imported})
+ else()
+ list(APPEND are_read_only ${read_only_properties_nonimported})
+ endif()
+
+ foreach(prop IN LISTS are_read_only)
+ set_target_properties(${target} PROPERTIES ${prop} "a_value")
+ endforeach()
+
+ if(policy160 STREQUAL "OLD")
+ foreach(prop IN LISTS read_only_properties_160)
+ set_target_properties(${target} PROPERTIES ${prop} "a_value")
+ endforeach()
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/CMP0160/RunCMakeTest.cmake b/Tests/RunCMake/CMP0160/RunCMakeTest.cmake
new file mode 100644
index 0000000..60380b5
--- /dev/null
+++ b/Tests/RunCMake/CMP0160/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0160-WARN)
+run_cmake(CMP0160-OLD)
+run_cmake(CMP0160-NEW)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index ef088aa..4aad417 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -168,6 +168,7 @@ endif()
add_RunCMake_test(CMP0153)
add_RunCMake_test(CMP0156 -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION})
+add_RunCMake_test(CMP0160)
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
diff --git a/Tests/RunCMake/NinjaMultiConfig/Common.cmake b/Tests/RunCMake/NinjaMultiConfig/Common.cmake
index 6c0d82a..9343eaf 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Common.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Common.cmake
@@ -37,7 +37,7 @@ function(generate_output_files)
set(exe_file " [==[$<TARGET_FILE_DIR:${tgt}>/$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>$<TARGET_FILE_SUFFIX:${tgt}>]==]")
set(exe_filename " [==[$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>$<TARGET_FILE_SUFFIX:${tgt}>]==]")
- if(WIN32)
+ if(WIN32 AND NOT generate_output_files_NO_EXE_LIB)
set(exe_lib_file " [==[$<TARGET_FILE_DIR:${tgt}>/$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>.lib]==]")
string(APPEND content "set(TARGET_EXE_LIB_FILE_${tgt}_$<CONFIG>${exe_lib_file})\n")
endif()
diff --git a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
index 00d8a1b..b5fc5b6 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
@@ -16,6 +16,9 @@ set_target_properties(simplecudaobj simplecudashared
add_executable(simplecudaexe main.cu )
target_link_libraries(simplecudaexe PRIVATE simplecudashared)
+if(WIN32 AND CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
+ set(generate_output_files_NO_EXE_LIB 1)
+endif()
include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
generate_output_files(simplecudaexe simplecudashared simplecudaobj)
diff --git a/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt b/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt
index 0955c61..d593b92 100644
--- a/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt
+++ b/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt
@@ -1 +1 @@
-swiftc .* -output-file-map CMakeFiles/greetings_default.dir//output-file-map.json .*
+swiftc(.exe)? .* -output-file-map CMakeFiles(/|\\)greetings_default.dir(//|\\\\)output-file-map.json .*
diff --git a/Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt b/Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt
index 3d70f12..ec396d7 100644
--- a/Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt
+++ b/Tests/RunCMake/Swift/ForceResponseFile-check-stdout.txt
@@ -1,2 +1,2 @@
-swiftc -j [0-9]+ -num-threads [0-9]+ -c @CMakeFiles/L.dir/L.o.swift.rsp
-.*swiftc -emit-library -static -o libL.a @CMakeFiles/L.rsp
+swiftc(.exe)? -j [0-9]+ -num-threads [0-9]+ -c @CMakeFiles(/|\\)L.dir(/|\\)L.o(bj)?.swift.rsp
+.*swiftc(.exe)? -emit-library -static -o (libL.a|L.lib) @CMakeFiles(/|\\)L.rsp
diff --git a/Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt b/Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt
index 7a882f8..efa3336 100644
--- a/Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt
+++ b/Tests/RunCMake/Swift/IncrementalSwift-second-stderr.txt
@@ -1,2 +1,2 @@
ninja explain: A.swiftmodule is dirty
-ninja explain: libB.a is dirty
+ninja explain: (libB.a|B.lib) is dirty
diff --git a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
index d644d6b..8e5b97c 100644
--- a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
+++ b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
@@ -1,3 +1,3 @@
-.*Building Swift object A.swiftmodule CMakeFiles/A.dir/a.swift.o
-.*Building Swift object B.swiftmodule CMakeFiles/B.dir/b.swift.o
-FAILED: B.swiftmodule CMakeFiles/B.dir/b.swift.o
+.*Building Swift object A.swiftmodule CMakeFiles(/|\\)A.dir(/|\\)a.swift.o(bj)?
+.*Building Swift object B.swiftmodule CMakeFiles(/|\\)B.dir(/|\\)b.swift.o(bj)?
+FAILED: B.swiftmodule CMakeFiles(/|\\)B.dir(/|\\)b.swift.o(bj)?
diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake
index 56158e3..3711efb 100644
--- a/Tests/RunCMake/Swift/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake
@@ -35,60 +35,62 @@ elseif(RunCMake_GENERATOR STREQUAL Ninja)
# Test that intermediate static libraries are rebuilt when the public
# interface of their dependency changes
block()
- set(IncrementalSwift_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/IncrementalSwift-build)
- set(IncrementalSwift_TEST_NO_CLEAN 1)
- set(IncrementalSwift_TEST_OUTPUT_MERGE 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/IncrementalSwift-build)
# Since files are modified during test, the files are created in the cmake
# file into the build directory
run_cmake(IncrementalSwift)
- run_cmake_command(IncrementalSwift-first ${CMAKE_COMMAND} --build ${IncrementalSwift_TEST_BINARY_DIR})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(IncrementalSwift-first ${CMAKE_COMMAND} --build .)
# Modify public interface of libA requiring rebuild of libB
- file(WRITE ${IncrementalSwift_TEST_BINARY_DIR}/a.swift
+ file(WRITE ${RunCMake_TEST_BINARY_DIR}/a.swift
"public func callA() -> Float { return 32.0 }\n")
# Note: We still expect this to fail, but instead of failure at link time,
# it should fail while re-compiling libB because the function changed
- run_cmake_command(IncrementalSwift-second ${CMAKE_COMMAND} --build ${IncrementalSwift_TEST_BINARY_DIR} -- -d explain)
+ run_cmake_command(IncrementalSwift-second ${CMAKE_COMMAND} --build . -- -d explain)
endblock()
block()
- set(CMP0157-OLD_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0157-OLD-build)
- set(CMP0157-OLD_TEST_NO_CLEAN 1)
- set(CMP0157-OLD_TEST_OUTPUT_MERGE 1)
-
run_cmake(CMP0157-NEW)
+ run_cmake(CMP0157-WARN)
+
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0157-OLD-build)
run_cmake(CMP0157-OLD)
+ set(RunCMake_TEST_NO_CLEAN 1)
# -n: dry-run to avoid actually compiling, -v: verbose to capture executed command
- run_cmake_command(CMP0157-OLD-build ${CMAKE_COMMAND} --build ${CMP0157-OLD_TEST_BINARY_DIR} -- -n -v)
- run_cmake(CMP0157-WARN)
+ run_cmake_command(CMP0157-OLD-build ${CMAKE_COMMAND} --build . -- -n -v)
endblock()
block()
- set(CompileCommands_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CompileCommands-build)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CompileCommands-build)
run_cmake(CompileCommands)
- run_cmake_command(CompileCommands-check ${CMAKE_COMMAND} --build ${CompileCommands_TEST_BINARY_DIR})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(CompileCommands-check ${CMAKE_COMMAND} --build .)
endblock()
block()
- set(ForceResponseFile_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ForceResponseFile-build)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ForceResponseFile-build)
run_cmake(ForceResponseFile)
+ set(RunCMake_TEST_NO_CLEAN 1)
# -v: verbose to capture executed commands -n: dry-run to avoid actually compiling
- run_cmake_command(ForceResponseFile-check ${CMAKE_COMMAND} --build ${ForceResponseFile_TEST_BINARY_DIR} -- -vn)
+ run_cmake_command(ForceResponseFile-check ${CMAKE_COMMAND} --build . -- -vn)
endblock()
block()
if(CMAKE_SYSTEM_NAME MATCHES Windows)
- set(ImportLibraryFlags_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SwiftLibraryModuleCommand-build)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ImportLibraryFlags-build)
run_cmake(ImportLibraryFlags)
- run_cmake_command(ImportLibraryFlags-check ${CMAKE_COMMAND} --build ${SwiftLibraryModuleCommand_TEST_BINARY_DIR} -- -n -v)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(ImportLibraryFlags-check ${CMAKE_COMMAND} --build . -- -n -v)
endif()
endblock()
block()
- set(SwiftLibraryModuleCommand_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SwiftLibraryModuleCommand-build)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SwiftLibraryModuleCommand-build)
run_cmake(SwiftLibraryModuleCommand)
- run_cmake_command(SwiftLibraryModuleCommand-check ${CMAKE_COMMAND} --build ${SwiftLibraryModuleCommand_TEST_BINARY_DIR} -- -n -v)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(SwiftLibraryModuleCommand-check ${CMAKE_COMMAND} --build . -- -n -v)
endblock()
endif()
elseif(RunCMake_GENERATOR STREQUAL "Ninja Multi-Config")
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 11d59b7..6b462d0 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -41,6 +41,7 @@
\* CMP0155
\* CMP0156
\* CMP0157
+ \* CMP0160
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
index e45fc64..8f575b5 100644
--- a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
+++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
@@ -23,8 +23,8 @@ Call Stack \(most recent call first\):
CMake Error at IMPORTED_GLOBAL.cmake:32 \(set_property\):
- IMPORTED_GLOBAL property can't be set on non-imported targets
- \(\"NonImportedTarget\"\)
+ IMPORTED_GLOBAL property can't be set on non-imported
+ targets\(\"NonImportedTarget\"\)
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt b/Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt
index 2307d13..50901fe 100644
--- a/Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt
+++ b/Tests/RunCMake/target_sources/FileSetReadOnlyInterface-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error at FileSetReadOnlyInterface\.cmake:[0-9]+ \(set_property\):
- INTERFACE_HEADER_SETS property is read-only
+ INTERFACE_HEADER_SETS property is read-only for target\("lib1"\)
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt b/Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt
index 5f955da..4767894 100644
--- a/Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt
+++ b/Tests/RunCMake/target_sources/FileSetReadOnlyPrivate-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error at FileSetReadOnlyPrivate\.cmake:[0-9]+ \(set_property\):
- HEADER_SETS property is read-only
+ HEADER_SETS property is read-only for target\("lib1"\)
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/SwiftMix/CMakeLists.txt b/Tests/SwiftMix/CMakeLists.txt
index e8b6521..a4bb19b 100644
--- a/Tests/SwiftMix/CMakeLists.txt
+++ b/Tests/SwiftMix/CMakeLists.txt
@@ -1,6 +1,9 @@
-cmake_minimum_required(VERSION 3.3)
+cmake_minimum_required(VERSION 3.15)
project(SwiftMix C Swift)
+# Swift on Windows only provides a release runtime.
+set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
+
add_executable(SwiftMix CMain.c ObjCMain.m SwiftMain.swift ObjC-Swift.h)
set_property(TARGET SwiftMix PROPERTY XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER "ObjC-Swift.h")
target_compile_options(SwiftMix PRIVATE "$<$<COMPILE_LANGUAGE:C>:-Werror=objc-method-access>")
diff --git a/Tests/SwiftMixLib/CMakeLists.txt b/Tests/SwiftMixLib/CMakeLists.txt
index a52fc94..d23c6ba 100644
--- a/Tests/SwiftMixLib/CMakeLists.txt
+++ b/Tests/SwiftMixLib/CMakeLists.txt
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.24)
project(SwiftMixLib C CXX Swift)
+# Swift on Windows only provides a release runtime.
+set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreadedDLL)
+
add_library(SwiftMixedLib lib.c lib.cpp lib.swift)
add_executable(Swifty main.swift)
target_link_libraries(Swifty PUBLIC SwiftMixedLib)
diff --git a/Tests/SwiftOnly/SubA/SubA.swift b/Tests/SwiftOnly/SubA/SubA.swift
index e69de29..09ddd88 100644
--- a/Tests/SwiftOnly/SubA/SubA.swift
+++ b/Tests/SwiftOnly/SubA/SubA.swift
@@ -0,0 +1 @@
+public func hi() { print("hi") }
diff --git a/Tests/SwiftOnly/SubB/SubB.swift b/Tests/SwiftOnly/SubB/SubB.swift
index d593c4c..142fdaa 100644
--- a/Tests/SwiftOnly/SubB/SubB.swift
+++ b/Tests/SwiftOnly/SubB/SubB.swift
@@ -1 +1,3 @@
import SubA
+
+public var number = 42
diff --git a/Utilities/Release/WiX/WIX.template.in b/Utilities/Release/WiX/WIX.template.in
index 8abf9d8..1f8953b 100644
--- a/Utilities/Release/WiX/WIX.template.in
+++ b/Utilities/Release/WiX/WIX.template.in
@@ -52,6 +52,7 @@
</FeatureRef>
<UIRef Id="$(var.CPACK_WIX_UI_REF)" />
+ <UIRef Id="WixUI_ErrorProgressText" />
<?include "properties.wxi"?>
<?include "product_fragment.wxi"?>