summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-07-01 12:20:15 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-07-17 13:55:58 (GMT)
commit3c685a578a44063bb027787426d2c8b7202a7979 (patch)
tree7d531d9c9f571723f827beb4e762f5d422aab1d8 /Tests
parenta28217eb8c3c8fd6287661dc3b4bc56a14e0d019 (diff)
downloadCMake-3c685a578a44063bb027787426d2c8b7202a7979.zip
CMake-3c685a578a44063bb027787426d2c8b7202a7979.tar.gz
CMake-3c685a578a44063bb027787426d2c8b7202a7979.tar.bz2
LINK_OPTIONS: ensure correct dollar escaping
Ensure correct escaping for Ninja and Makefile generators. Fixes: #25049
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/RunCMakeTest.cmake2
4 files changed, 10 insertions, 1 deletions
diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake
new file mode 100644
index 0000000..0f897fe
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "BADFLAG_\\$dollar")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_$dollar'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS-dollar-option-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake
index bb04841..879151b 100644
--- a/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake
+++ b/Tests/RunCMake/target_link_options/LINK_OPTIONS.cmake
@@ -53,3 +53,7 @@ target_link_options(LinkOptions_mod PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RE
# executable with generator expression
add_executable(LinkOptions_exe LinkOptionsExe.c)
target_link_options(LinkOptions_exe PRIVATE $<$<CONFIG:Release>:${pre}BADFLAG_RELEASE${obj}>)
+
+# executable with dollar character
+add_executable(LinkOptions_dollar_exe LinkOptionsExe.c)
+target_link_options(LinkOptions_dollar_exe PRIVATE "${pre}BADFLAG_$dollar${obj}")
diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
index 1a29ecf..ff0c5a8 100644
--- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
@@ -30,7 +30,7 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
run_cmake_target(LINK_OPTIONS shared LinkOptions_shared --config Release)
run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release)
run_cmake_target(LINK_OPTIONS exe LinkOptions_exe --config Release)
-
+ run_cmake_target(LINK_OPTIONS dollar-option LinkOptions_dollar_exe --config Release)
run_cmake(genex_LINK_LANGUAGE)