diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 15 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/UnityBuildPCH-build-check.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/UnityBuildPCH.c | 4 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/UnityBuildPCH.cmake | 4 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/UnityBuildPCH.h | 1 |
5 files changed, 34 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index d5ed136..f945b43 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -64,6 +64,21 @@ if (RunCMake_GENERATOR MATCHES "Visual Studio 1[0-4] 201[0-5]" OR else() run_cmake(UnityBuildNative) run_cmake(UnityBuildNativeGrouped) + + function(run_UnityBuildPCH) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/UnityBuildPCH-build) + run_cmake(UnityBuildPCH) + set(RunCMake_TEST_NO_CLEAN 1) + set(vcxproj "${RunCMake_TEST_BINARY_DIR}/UnityBuildPCH.vcxproj") + if(EXISTS "${vcxproj}") + file(STRINGS ${vcxproj} vcxproj_strings REGEX "ClCompile[^\n]*UnityBuildPCH\\.c") + endif() + if(vcxproj_strings MATCHES "Include=\"([^\"]+)\"") + set(src "${CMAKE_MATCH_1}") + run_cmake_command(UnityBuildPCH-build ${CMAKE_COMMAND} --build . --config Debug --target UnityBuildPCH -- -t:ClCompile -p:SelectedFiles=${src}) + endif() + endfunction() + run_UnityBuildPCH() endif() run_cmake(VsDotnetTargetFramework) diff --git a/Tests/RunCMake/VS10Project/UnityBuildPCH-build-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildPCH-build-check.cmake new file mode 100644 index 0000000..9043bb7 --- /dev/null +++ b/Tests/RunCMake/VS10Project/UnityBuildPCH-build-check.cmake @@ -0,0 +1,10 @@ +set(obj "${RunCMake_TEST_BINARY_DIR}/UnityBuildPCH.dir/Debug/UnityBuildPCH.obj") +if(NOT EXISTS "${obj}") + set(RunCMake_TEST_FAILED "Expected object file does not exist:\n ${obj}") + return() +endif() +set(lib "${RunCMake_TEST_BINARY_DIR}/Debug/UnityBuildPCH.lib") +if(EXISTS "${lib}") + set(RunCMake_TEST_FAILED "Unexpected library file exists:\n ${lib}") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/UnityBuildPCH.c b/Tests/RunCMake/VS10Project/UnityBuildPCH.c new file mode 100644 index 0000000..b96b068 --- /dev/null +++ b/Tests/RunCMake/VS10Project/UnityBuildPCH.c @@ -0,0 +1,4 @@ +int UnityBuildPCH(void) +{ + return 0; +} diff --git a/Tests/RunCMake/VS10Project/UnityBuildPCH.cmake b/Tests/RunCMake/VS10Project/UnityBuildPCH.cmake new file mode 100644 index 0000000..875ffec --- /dev/null +++ b/Tests/RunCMake/VS10Project/UnityBuildPCH.cmake @@ -0,0 +1,4 @@ +enable_language(C) +add_library(UnityBuildPCH STATIC UnityBuildPCH.c) +target_precompile_headers(UnityBuildPCH PRIVATE UnityBuildPCH.h) +set_property(TARGET UnityBuildPCH PROPERTY UNITY_BUILD ON) diff --git a/Tests/RunCMake/VS10Project/UnityBuildPCH.h b/Tests/RunCMake/VS10Project/UnityBuildPCH.h new file mode 100644 index 0000000..fa882cb --- /dev/null +++ b/Tests/RunCMake/VS10Project/UnityBuildPCH.h @@ -0,0 +1 @@ +/* empty file */ |