summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/try_compile
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-01-13 16:19:29 (GMT)
committerBrad King <brad.king@kitware.com>2023-01-16 21:58:50 (GMT)
commit9d9e8450a872a4a9ec1a74cc7a73df100c32c7e8 (patch)
tree0ccb5c395ecf839e8d3d8252a4df0ddd563221cc /Tests/RunCMake/try_compile
parent65ed5c2ca816f8ba4068b163a2dcdab079df0038 (diff)
downloadCMake-9d9e8450a872a4a9ec1a74cc7a73df100c32c7e8.zip
CMake-9d9e8450a872a4a9ec1a74cc7a73df100c32c7e8.tar.gz
CMake-9d9e8450a872a4a9ec1a74cc7a73df100c32c7e8.tar.bz2
try_compile: Add optional LOG_DESCRIPTION to record in configure log
Issue: #23200
Diffstat (limited to 'Tests/RunCMake/try_compile')
-rw-r--r--Tests/RunCMake/try_compile/ConfigureLog-config.txt2
-rw-r--r--Tests/RunCMake/try_compile/ConfigureLog.cmake2
-rw-r--r--Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt8
-rw-r--r--Tests/RunCMake/try_compile/EmptyValueArgs.cmake3
-rw-r--r--Tests/RunCMake/try_compile/NoLogDescription-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/NoLogDescription-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/NoLogDescription.cmake4
-rw-r--r--Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake1
8 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/ConfigureLog-config.txt b/Tests/RunCMake/try_compile/ConfigureLog-config.txt
index 6ed3bfe..caf8a71 100644
--- a/Tests/RunCMake/try_compile/ConfigureLog-config.txt
+++ b/Tests/RunCMake/try_compile/ConfigureLog-config.txt
@@ -21,6 +21,7 @@ events:
backtrace:
- "ConfigureLog.cmake:[0-9]+ \(try_compile\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
+ description: "Source that should not compile\."
directories:
source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+"
binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+"
@@ -34,6 +35,7 @@ events:
backtrace:
- "ConfigureLog.cmake:[0-9]+ \(try_compile\)"
- "CMakeLists.txt:[0-9]+ \(include\)"
+ description: "Source that should compile\."
directories:
source: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+"
binary: "[^"]*/Tests/RunCMake/try_compile/ConfigureLog-build/CMakeFiles/CMakeScratch/TryCompile-[^/]+"
diff --git a/Tests/RunCMake/try_compile/ConfigureLog.cmake b/Tests/RunCMake/try_compile/ConfigureLog.cmake
index f475014..4502d24 100644
--- a/Tests/RunCMake/try_compile/ConfigureLog.cmake
+++ b/Tests/RunCMake/try_compile/ConfigureLog.cmake
@@ -2,8 +2,10 @@ enable_language(C)
try_compile(COMPILE_RESULT
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-bad.c
+ LOG_DESCRIPTION "Source that should not compile."
)
try_compile(COMPILE_RESULT
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c
+ LOG_DESCRIPTION "Source that should compile."
)
diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt b/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt
index b1344bd..b03e0b3 100644
--- a/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt
+++ b/Tests/RunCMake/try_compile/EmptyValueArgs-stderr.txt
@@ -7,3 +7,11 @@ CMake Error at EmptyValueArgs.cmake:[0-9]+ \(try_compile\):
COPY_FILE_ERROR must be followed by a variable name
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Error at EmptyValueArgs.cmake:[0-9]+ \(try_compile\):
+ Error after keyword "LOG_DESCRIPTION":
+
+ empty string not allowed
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/try_compile/EmptyValueArgs.cmake b/Tests/RunCMake/try_compile/EmptyValueArgs.cmake
index fda4f10..f0052c5 100644
--- a/Tests/RunCMake/try_compile/EmptyValueArgs.cmake
+++ b/Tests/RunCMake/try_compile/EmptyValueArgs.cmake
@@ -5,3 +5,6 @@ try_compile(RESULT ${try_compile_bindir_or_SOURCES}
try_compile(RESULT ${try_compile_bindir_or_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/src.c
COPY_FILE "x" COPY_FILE_ERROR "")
+try_compile(RESULT ${try_compile_bindir_or_SOURCES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ LOG_DESCRIPTION "")
diff --git a/Tests/RunCMake/try_compile/NoLogDescription-result.txt b/Tests/RunCMake/try_compile/NoLogDescription-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoLogDescription-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt b/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt
new file mode 100644
index 0000000..9005bcd
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoLogDescription-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at NoLogDescription.cmake:[0-9]+ \(try_compile\):
+ Error after keyword "LOG_DESCRIPTION":
+
+ missing required value
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoLogDescription.cmake b/Tests/RunCMake/try_compile/NoLogDescription.cmake
new file mode 100644
index 0000000..904763f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoLogDescription.cmake
@@ -0,0 +1,4 @@
+include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS})
+try_compile(RESULT ${try_compile_bindir_or_SOURCES}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ LOG_DESCRIPTION)
diff --git a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake
index 3158e32..0e4cc20 100644
--- a/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake
+++ b/Tests/RunCMake/try_compile/old_and_new_signature_tests.cmake
@@ -12,6 +12,7 @@ run_cmake(NoCopyFile)
run_cmake(NoCopyFile2)
run_cmake(NoCopyFileError)
run_cmake(NoCStandard)
+run_cmake(NoLogDescription)
run_cmake(NoOutputVariable)
run_cmake(NoOutputVariable2)
run_cmake(BadLinkLibraries)