Files
CMake/Tests/RunCMake/VS10Project/UnityBuildPCH-build-check.cmake
Brad King 71f15be957 VS: Fix compilation of single source with PCH in Unity Build
Sources that are part of a unity build are normally not compiled
individually.  However, the VS IDE allows a single source to be
compiled.  This can also be achieved on the command line:

    msbuild my.vcxproj ... -t:ClCompile -p:SelectedFiles=<src>

where `<src>` is the path in the vcxproj `ClCompile` entry.

In a target with precompiled headers, the source needs PCH settings to
support individual compilation even if the normal unity build does not.
2021-10-19 11:50:07 -04:00

11 lines
375 B
CMake

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()