
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.
5 lines
193 B
CMake
5 lines
193 B
CMake
enable_language(C)
|
|
add_library(UnityBuildPCH STATIC UnityBuildPCH.c)
|
|
target_precompile_headers(UnityBuildPCH PRIVATE UnityBuildPCH.h)
|
|
set_property(TARGET UnityBuildPCH PROPERTY UNITY_BUILD ON)
|