summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/generator/Xcode.rst10
-rw-r--r--Modules/CMakeDetermineHIPCompiler.cmake1
-rw-r--r--Modules/CMakeHIPInformation.cmake2
-rw-r--r--Modules/CPackIFW.cmake42
-rw-r--r--Modules/CUDA/architectures.cmake6
-rw-r--r--Modules/Compiler/Intel.cmake14
-rw-r--r--Modules/Compiler/IntelLLVM.cmake12
-rw-r--r--Modules/Compiler/NVHPC.cmake2
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake2
-rw-r--r--Modules/Compiler/Tasking.cmake4
-rw-r--r--Modules/Internal/CPack/NSIS.template.in19
-rw-r--r--Modules/Platform/Windows-Clang-HIP.cmake19
-rw-r--r--Modules/Platform/Windows-Clang.cmake45
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx21
-rw-r--r--Source/cmGeneratorTarget.cxx6
-rw-r--r--Source/cmLocalGenerator.cxx10
-rw-r--r--Tests/CheckSourceTree/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets-check.cmake2
-rw-r--r--Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake9
-rw-r--r--Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt2
-rw-r--r--Utilities/Sphinx/cmake.py18
22 files changed, 185 insertions, 69 deletions
diff --git a/Help/generator/Xcode.rst b/Help/generator/Xcode.rst
index fc7eea1..a66f483 100644
--- a/Help/generator/Xcode.rst
+++ b/Help/generator/Xcode.rst
@@ -44,3 +44,13 @@ Swift Support
When using the :generator:`Xcode` generator with Xcode 6.1 or higher,
one may enable the ``Swift`` language with the :command:`enable_language`
command or the :command:`project`.
+
+Limitations
+^^^^^^^^^^^
+
+The Xcode generator does not support per-configuration sources.
+Code like the following will result in a generation error:
+
+.. code-block:: cmake
+
+ add_executable(MyApp mymain-$<CONFIG>.cpp)
diff --git a/Modules/CMakeDetermineHIPCompiler.cmake b/Modules/CMakeDetermineHIPCompiler.cmake
index 7b7d7a3..6294d04 100644
--- a/Modules/CMakeDetermineHIPCompiler.cmake
+++ b/Modules/CMakeDetermineHIPCompiler.cmake
@@ -86,6 +86,7 @@ if(NOT CMAKE_HIP_COMPILER_ROCM_ROOT AND CMAKE_HIP_COMPILER_ID STREQUAL "Clang")
if(_CMAKE_HIP_COMPILER_RESULT EQUAL 0 AND _CMAKE_HIP_COMPILER_STDERR MATCHES "Found HIP installation: *([^,]*)[,\n]")
set(CMAKE_HIP_COMPILER_ROCM_ROOT "${CMAKE_MATCH_1}")
+ file(TO_CMAKE_PATH "${CMAKE_HIP_COMPILER_ROCM_ROOT}" CMAKE_HIP_COMPILER_ROCM_ROOT)
endif()
endif()
if(NOT CMAKE_HIP_COMPILER_ROCM_ROOT)
diff --git a/Modules/CMakeHIPInformation.cmake b/Modules/CMakeHIPInformation.cmake
index 4c57677..33f8697 100644
--- a/Modules/CMakeHIPInformation.cmake
+++ b/Modules/CMakeHIPInformation.cmake
@@ -143,7 +143,7 @@ set(CMAKE_HIP_INFORMATION_LOADED 1)
# Load the file and find the relevant HIP runtime.
if(NOT DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
set(hip-lang_DIR "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/cmake/hip-lang")
- find_package(hip-lang CONFIG QUIET NO_DEFAULT_PATH)
+ find_package(hip-lang CONFIG QUIET NO_DEFAULT_PATH REQUIRED)
endif()
if(DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
list(APPEND CMAKE_HIP_RUNTIME_LIBRARIES_STATIC ${_CMAKE_HIP_DEVICE_RUNTIME_TARGET})
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index a4bfe1d..efe6999 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -439,37 +439,55 @@ set(_CPACK_IFW_PREFIXES
"QtIFW-")
set(_CPACK_IFW_VERSIONS
+ "4.4.2"
+ "4.4.1"
+ "4.4.0"
"4.4"
+ "4.3.0"
"4.3"
+ "4.2.0"
"4.2"
+ "4.1.1"
+ "4.1.0"
"4.1"
+ "4.0.1"
+ "4.0.0"
"4.0"
- "3.2"
+ "3.2.3"
+ "3.2.2"
+ "3.2.1"
"3.2.0"
- "3.1"
+ "3.2"
+ "3.1.1"
"3.1.0"
- "3.0"
+ "3.1"
+ "3.0.6"
+ "3.0.4"
+ "3.0.3"
+ "3.0.2"
+ "3.0.1"
"3.0.0"
- "2.3"
+ "3.0"
"2.3.0"
- "2.2"
+ "2.3"
"2.2.0"
- "2.1"
+ "2.2"
"2.1.0"
- "2.0"
+ "2.1"
"2.0.5"
"2.0.3"
"2.0.2"
"2.0.1"
"2.0.0"
- "1.6"
+ "2.0"
"1.6.0"
- "1.5"
+ "1.6"
"1.5.0"
- "1.4"
+ "1.5"
"1.4.0"
- "1.3"
- "1.3.0")
+ "1.4"
+ "1.3.0"
+ "1.3")
set(_CPACK_IFW_SUFFIXES "bin")
foreach(_CPACK_IFW_PREFIX ${_CPACK_IFW_PREFIXES})
diff --git a/Modules/CUDA/architectures.cmake b/Modules/CUDA/architectures.cmake
index 79c1252..d646920 100644
--- a/Modules/CUDA/architectures.cmake
+++ b/Modules/CUDA/architectures.cmake
@@ -45,6 +45,12 @@ if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 11.4
list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 87)
endif()
+if(CMAKE_CUDA_COMPILER_TOOLKIT_VERSION VERSION_GREATER_EQUAL 11.8
+ AND (NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Clang"))
+ list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL 89 90)
+ list(APPEND CMAKE_CUDA_ARCHITECTURES_ALL_MAJOR 90)
+endif()
+
# only generate jit code for the newest arch for all/all-major
list(POP_BACK CMAKE_CUDA_ARCHITECTURES_ALL _latest_arch)
list(TRANSFORM CMAKE_CUDA_ARCHITECTURES_ALL APPEND "-real")
diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake
index 20989d2..642e58a 100644
--- a/Modules/Compiler/Intel.cmake
+++ b/Modules/Compiler/Intel.cmake
@@ -13,7 +13,11 @@ include(Compiler/CMakeCommonCompilerMacros)
if(CMAKE_HOST_WIN32)
# MSVC-like
macro(__compiler_intel lang)
- set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror-all")
+ if("x${lang}" STREQUAL "xFortran")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-warn:errors")
+ else()
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror-all")
+ endif()
endmacro()
else()
# GNU-like
@@ -25,7 +29,6 @@ else()
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Os")
string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3")
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g")
- set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror-all")
set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}")
if(CMAKE_${lang}_COMPILER_ARG1)
@@ -35,7 +38,9 @@ else()
endif()
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
- if(NOT "x${lang}" STREQUAL "xFortran")
+ if("x${lang}" STREQUAL "xFortran")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-warn" "errors")
+ else()
# Precompile Headers
set(CMAKE_PCH_EXTENSION .pchi)
set(CMAKE_LINK_PCH ON)
@@ -43,6 +48,9 @@ else()
set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Wno-pch-messages -pch-use <PCH_FILE> -include <PCH_HEADER>)
set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Wno-pch-messages -pch-create <PCH_FILE> -include <PCH_HEADER>)
+
+ # COMPILE_WARNING_AS_ERROR
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror-all")
endif()
endmacro()
endif()
diff --git a/Modules/Compiler/IntelLLVM.cmake b/Modules/Compiler/IntelLLVM.cmake
index 3f22efd..30de1a9 100644
--- a/Modules/Compiler/IntelLLVM.cmake
+++ b/Modules/Compiler/IntelLLVM.cmake
@@ -27,7 +27,9 @@ endmacro()
if(CMAKE_HOST_WIN32)
# MSVC-like
macro(__compiler_intel_llvm lang)
- if(NOT "x${lang}" STREQUAL "xFortran")
+ if("x${lang}" STREQUAL "xFortran")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-warn:errors")
+ else()
set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-WX")
endif()
@@ -51,7 +53,6 @@ else()
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie")
set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie")
- set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
@@ -90,7 +91,9 @@ else()
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
endif()
- if(NOT "x${lang}" STREQUAL "xFortran")
+ if("x${lang}" STREQUAL "xFortran")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-warn" "errors")
+ else()
# Precompile Headers
set(CMAKE_PCH_EXTENSION .pch)
set(CMAKE_PCH_PROLOGUE "#pragma clang system_header")
@@ -98,6 +101,9 @@ else()
set(CMAKE_${lang}_COMPILE_OPTIONS_INVALID_PCH -Winvalid-pch)
set(CMAKE_${lang}_COMPILE_OPTIONS_USE_PCH -Xclang -include-pch -Xclang <PCH_FILE> -Xclang -include -Xclang <PCH_HEADER>)
set(CMAKE_${lang}_COMPILE_OPTIONS_CREATE_PCH -Xclang -emit-pch -Xclang -include -Xclang <PCH_HEADER> -x ${__pch_header_${lang}})
+
+ # COMPILE_WARNING_AS_ERROR
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror")
endif()
endmacro()
endif()
diff --git a/Modules/Compiler/NVHPC.cmake b/Modules/Compiler/NVHPC.cmake
index 957dacd..474ac80 100644
--- a/Modules/Compiler/NVHPC.cmake
+++ b/Modules/Compiler/NVHPC.cmake
@@ -13,5 +13,5 @@ include(Compiler/PGI)
macro(__compiler_nvhpc lang)
# Logic specific to NVHPC.
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
- set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror all-warnings")
+ set(CMAKE_${lang}_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror" "all-warnings")
endmacro()
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index 2b8a1ea..c8dcd2a 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -31,7 +31,7 @@ endif()
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
# Starting in 10.2, nvcc supported treating all warnings as errors
- set(CMAKE_CUDA_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror all-warnings")
+ set(CMAKE_CUDA_COMPILE_OPTIONS_WARNING_AS_ERROR "-Werror" "all-warnings")
endif()
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
diff --git a/Modules/Compiler/Tasking.cmake b/Modules/Compiler/Tasking.cmake
index 30d4c69..d0c2f79 100644
--- a/Modules/Compiler/Tasking.cmake
+++ b/Modules/Compiler/Tasking.cmake
@@ -21,9 +21,9 @@ function(__tasking_set_processor_list lang out_var)
execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" --cpu-list
OUTPUT_VARIABLE processor_list
ERROR_VARIABLE processor_list)
- string(REGEX MATCHALL "[ ]+([A-Za-z0-9_]+)[ ]+[^ ]([^ ]+ ?)*[ ]+[A-Za-z0-9\\.]+[ ]+[A-Za-z0-9\.]+\n" processor_list "${processor_list}")
+ string(REGEX MATCHALL " +([A-Za-z0-9_]+)[^\n]+\n" processor_list "${processor_list}")
list(POP_FRONT processor_list)
- string(REGEX REPLACE "[ ]+([A-Za-z0-9_]+)[ ]+[^ ]([^ ]+ ?)*[ ]+[A-Za-z0-9\\.]+[ ]+[A-Za-z0-9\.]+\n" "\\1" processor_list "${processor_list}")
+ string(REGEX REPLACE " +([A-Za-z0-9_]+)[^\n]+\n" "\\1" processor_list "${processor_list}")
set(${out_var} "${processor_list}" PARENT_SCOPE)
endfunction()
diff --git a/Modules/Internal/CPack/NSIS.template.in b/Modules/Internal/CPack/NSIS.template.in
index 42a44d9..21753af 100644
--- a/Modules/Internal/CPack/NSIS.template.in
+++ b/Modules/Internal/CPack/NSIS.template.in
@@ -931,11 +931,20 @@ Function .onInit
;Run the uninstaller
uninst:
ClearErrors
- StrCpy $2 $0 1
- StrCmp '"' $2 0 +3 ; checks if string is quoted (CPack before v3.20.6 did not quote it)
- ExecWait '$0 /S'
- Goto +2
- ExecWait '"$0" /S'
+ # $0 should _always_ be quoted, however older versions of CMake did not
+ # do this. We'll conditionally remove the begin/end quotes.
+ # Remove first char if quote
+ StrCpy $2 $0 1 0 # copy first char
+ StrCmp $2 "$\"" 0 +2 # if char is quote
+ StrCpy $0 $0 "" 1 # remove first char
+ # Remove last char if quote
+ StrCpy $2 $0 1 -1 # copy last char
+ StrCmp $2 "$\"" 0 +2 # if char is quote
+ StrCpy $0 $0 -1 # remove last char
+
+ StrLen $2 "\@CPACK_NSIS_UNINSTALL_NAME@.exe"
+ StrCpy $3 $0 -$2 # remove "\@CPACK_NSIS_UNINSTALL_NAME@.exe" from UninstallString to get path
+ ExecWait '"$0" /S _?=$3' ;Do not copy the uninstaller to a temp file
IfErrors uninst_failed inst
uninst_failed:
diff --git a/Modules/Platform/Windows-Clang-HIP.cmake b/Modules/Platform/Windows-Clang-HIP.cmake
new file mode 100644
index 0000000..20879fa
--- /dev/null
+++ b/Modules/Platform/Windows-Clang-HIP.cmake
@@ -0,0 +1,19 @@
+include(Platform/Windows-Clang)
+set(_COMPILE_HIP_MSVC " -TP")
+__windows_compiler_clang(HIP)
+
+if("x${CMAKE_HIP_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_HIP)
+ set(CMAKE_HIP_DEPENDS_USE_COMPILER TRUE)
+ endif()
+elseif("x${CMAKE_HIP_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_HIP)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_HIP_DEPFILE_FORMAT gcc)
+ set(CMAKE_HIP_DEPENDS_USE_COMPILER TRUE)
+ endif()
+endif()
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 5edcb61..33d271d 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -157,24 +157,36 @@ macro(__enable_llvm_rc_preprocessing clang_option_prefix extra_pp_flags)
endif()
endmacro()
+macro(__verify_same_language_values variable)
+ foreach(lang "C" "CXX" "HIP")
+ if(DEFINED CMAKE_${lang}_${variable})
+ list(APPEND __LANGUAGE_VALUES_${variable} "${CMAKE_${lang}_${variable}}")
+ endif()
+ endforeach()
+ list(REMOVE_DUPLICATES __LANGUAGE_VALUES_${variable})
+ list(LENGTH __LANGUAGE_VALUES_${variable} __NUM_VALUES)
+
+ if(__NUM_VALUES GREATER 1)
+ message(FATAL_ERROR ${ARGN})
+ endif()
+ unset(__NUM_VALUES)
+ unset(__LANGUAGE_VALUES_${variable})
+endmacro()
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
- OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"
+ OR "x${CMAKE_HIP_SIMULATE_ID}" STREQUAL "xMSVC")
- if ( DEFINED CMAKE_C_COMPILER_ID AND DEFINED CMAKE_CXX_COMPILER_ID
- AND NOT "x${CMAKE_C_COMPILER_ID}" STREQUAL "x${CMAKE_CXX_COMPILER_ID}")
- message(FATAL_ERROR "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 and C++ compilers.")
- endif()
+ __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.")
- if ( DEFINED CMAKE_C_COMPILER_FRONTEND_VARIANT AND DEFINED CMAKE_CXX_COMPILER_FRONTEND_VARIANT
- AND NOT "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}")
- message(FATAL_ERROR "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 and C++ compilers.")
- endif()
+ __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.")
if(NOT CMAKE_RC_COMPILER_INIT)
# Check if rc is already in the path
@@ -194,7 +206,10 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
unset(__RC_COMPILER_PATH CACHE)
endif()
- if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" )
+ if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"
+ OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"
+ OR "x${CMAKE_HIP_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+
include(Platform/Windows-MSVC)
# Set the clang option forwarding prefix for clang-cl usage in the llvm-rc processing stage
__enable_llvm_rc_preprocessing("-clang:" "")
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 45504d4..8ecec45 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 24)
-set(CMake_VERSION_PATCH 20221007)
+set(CMake_VERSION_PATCH 20221011)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 788845b..6f6a642 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -1177,6 +1177,13 @@ bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput(
// generic error: ignore ERROR SUMMARY, CUDA-MEMCHECK and others
"== ([A-Z][a-z].*)"
};
+ // matchers for messages that aren't defects, but caught by above matchers
+ std::vector<cmsys::RegularExpression> false_positive_matchers{
+ "== Error: No attachable process found.*timed-out",
+ "== Default timeout can be adjusted with --launch-timeout",
+ "== Error: Target application terminated before first instrumented API",
+ "== Tracking kernels launched by child processes requires"
+ };
std::vector<std::string::size_type> nonMemcheckOutput;
auto sttime = std::chrono::steady_clock::now();
@@ -1196,11 +1203,17 @@ bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput(
if (leakExpr.find(line)) {
failure = static_cast<int>(this->FindOrAddWarning("Memory leak"));
} else {
- for (auto& matcher : matchers) {
- if (matcher.find(line)) {
+ auto match_predicate =
+ [&line](cmsys::RegularExpression& matcher) -> bool {
+ return matcher.find(line);
+ };
+ auto const pos_matcher =
+ std::find_if(matchers.begin(), matchers.end(), match_predicate);
+ if (pos_matcher != matchers.end()) {
+ if (!std::any_of(false_positive_matchers.begin(),
+ false_positive_matchers.end(), match_predicate)) {
failure =
- static_cast<int>(this->FindOrAddWarning(matcher.match(1)));
- break;
+ static_cast<int>(this->FindOrAddWarning(pos_matcher->match(1)));
}
}
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 53cb030..6195d1f 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -8760,7 +8760,11 @@ std::string cmGeneratorTarget::GenerateHeaderSetVerificationFile(
cmGeneratedFileStream fout(filename);
fout.SetCopyIfDifferent(true);
- fout << "#include <" << headerFilename << ">\n";
+ // IWYU pragma: associated allows include what you use to
+ // consider the headerFile as part of the entire language
+ // unit within include-what-you-use and as a result allows
+ // one to get IWYU advice for headers :)
+ fout << "#include <" << headerFilename << "> // IWYU pragma: associated\n";
fout.close();
return filename;
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index defcba3..2a50dd3 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1030,10 +1030,14 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags,
// Add Warning as errors flags
if (!this->GetCMakeInstance()->GetIgnoreWarningAsError()) {
const cmValue wError = target->GetProperty("COMPILE_WARNING_AS_ERROR");
- const cmValue wErrorFlag = this->Makefile->GetDefinition(
+ const cmValue wErrorOpts = this->Makefile->GetDefinition(
cmStrCat("CMAKE_", lang, "_COMPILE_OPTIONS_WARNING_AS_ERROR"));
- if (wError.IsOn() && wErrorFlag.IsSet()) {
- flags.emplace_back(wErrorFlag);
+ if (wError.IsOn() && wErrorOpts.IsSet()) {
+ std::string wErrorFlags;
+ this->AppendCompileOptions(wErrorFlags, *wErrorOpts);
+ if (!wErrorFlags.empty()) {
+ flags.emplace_back(std::move(wErrorFlags));
+ }
}
}
diff --git a/Tests/CheckSourceTree/CMakeLists.txt b/Tests/CheckSourceTree/CMakeLists.txt
index d5019d2..3abc6a9 100644
--- a/Tests/CheckSourceTree/CMakeLists.txt
+++ b/Tests/CheckSourceTree/CMakeLists.txt
@@ -1,6 +1,6 @@
add_test(NAME CMake.CheckSourceTree
- COMMAND ${CMAKE_COMMAND} -D GIT_EXECUTABLE=${GIT_EXECUTABLE}
- -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
- -P ${CMAKE_CURRENT_LIST_DIR}/check.cmake
+ COMMAND ${CMAKE_CMAKE_COMMAND} -D GIT_EXECUTABLE=${GIT_EXECUTABLE}
+ -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
+ -P ${CMAKE_CURRENT_LIST_DIR}/check.cmake
)
set_property(TEST CMake.CheckSourceTree PROPERTY RUN_SERIAL 1)
diff --git a/Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets-check.cmake b/Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets-check.cmake
index 100f482..4d5508d 100644
--- a/Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets-check.cmake
+++ b/Tests/RunCMake/VerifyHeaderSets/VerifyHeaderSets-check.cmake
@@ -9,7 +9,7 @@ function(check_file target filename)
if(filename MATCHES "^(.*)(\\.[a-z]+)$")
set(header_filename "${CMAKE_MATCH_1}")
endif()
- set(expected_contents "#include <${header_filename}>\n")
+ set(expected_contents "#include <${header_filename}> // IWYU pragma: associated\n")
file(READ "${full_filename}" actual_contents)
if(NOT actual_contents STREQUAL expected_contents)
diff --git a/Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake
index adc7a1a..850f72c 100644
--- a/Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testCudaSanitizer.cmake
@@ -277,3 +277,12 @@ file(APPEND "${LOG_FILE}"
=========
========= RACECHECK SUMMARY: 12 hazards displayed (0 errors, 12 warnings)
")
+
+# false-positives
+file(APPEND "${LOG_FILE}"
+"========= COMPUTE-SANITIZER
+========= Error: Target application terminated before first instrumented API call
+========= Tracking kernels launched by child processes requires the --target-processes all option.
+========= Error: No attachable process found. compute-sanitizer timed-out.
+========= Default timeout can be adjusted with --launch-timeout. Awaiting target completion.
+")
diff --git a/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt
index db8ca10..c520de1 100644
--- a/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt
+++ b/Tests/RunCMake/install/DIRECTORY-symlink-clobber-all-stdout.txt
@@ -6,7 +6,7 @@
]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk
-- Installing: [^
]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk
--- Up-to-date: [^
+-- (Up-to-date|Installing): [^
]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/lnk/file
-- Installing: [^
]*/Tests/RunCMake/install/DIRECTORY-symlink-clobber-build/root-all/dest/dir
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 9215e14..c7b1233 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -59,12 +59,6 @@ CMakeLexer.tokens["root"] = [
from docutils.parsers.rst import Directive, directives
from docutils.transforms import Transform
-try:
- from docutils.utils.error_reporting import SafeString, ErrorString
-except ImportError:
- # error_reporting was not in utils before version 0.11:
- from docutils.error_reporting import SafeString, ErrorString
-
from docutils import io, nodes
from sphinx.directives import ObjectDescription
@@ -130,13 +124,13 @@ class CMakeModule(Directive):
f = io.FileInput(source_path=path, encoding=encoding,
error_handler=e_handler)
except UnicodeEncodeError as error:
- raise self.severe('Problems with "%s" directive path:\n'
- 'Cannot encode input file path "%s" '
- '(wrong locale?).' %
- (self.name, SafeString(path)))
+ msg = ('Problems with "%s" directive path:\n'
+ 'Cannot encode input file path "%s" '
+ '(wrong locale?).' % (self.name, path))
+ raise self.severe(msg)
except IOError as error:
- raise self.severe('Problems with "%s" directive path:\n%s.' %
- (self.name, ErrorString(error)))
+ msg = 'Problems with "%s" directive path:\n%s.' % (self.name, error)
+ raise self.severe(msg)
raw_lines = f.read().splitlines()
f.close()
rst = None