Tests: Add RunCMake.try_compile case for try_run-only args

This commit is contained in:
Brad King
2022-08-02 08:03:53 -04:00
parent b8e551ed32
commit 3218ea60de
3 changed files with 83 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ run_cmake(BinDirEmpty)
run_cmake(BinDirRelative)
run_cmake(EmptyValueArgs)
run_cmake(EmptyListArgs)
run_cmake(TryRunArgs)
run_cmake(EnvConfig)

View File

@@ -0,0 +1,71 @@
^CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "COMPILE_OUTPUT_VARIABLE".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "compOutputVar".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "RUN_OUTPUT_VARIABLE".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "runOutputVar".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "RUN_OUTPUT_STDOUT_VARIABLE".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "runOutputStdOutVar".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "RUN_OUTPUT_STDERR_VARIABLE".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "runOutputStdErrVar".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "WORKING_DIRECTORY".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "runWorkDir".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "ARGS".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at TryRunArgs.cmake:[0-9]+ \(try_compile\):
try_compile given unknown argument "runArgs".
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.$

View File

@@ -0,0 +1,11 @@
enable_language(C)
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/out.bin"
COMPILE_OUTPUT_VARIABLE compOutputVar
RUN_OUTPUT_VARIABLE runOutputVar
RUN_OUTPUT_STDOUT_VARIABLE runOutputStdOutVar
RUN_OUTPUT_STDERR_VARIABLE runOutputStdErrVar
WORKING_DIRECTORY runWorkDir
ARGS runArgs
)