diff options
author | Ray Molenkamp <github@lazydodo.com> | 2020-08-27 17:10:37 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2020-08-27 17:10:37 +0300 |
commit | 8a984ddd0f4b10e251339986232301c94b2dd3b3 (patch) | |
tree | a89f19f695bf620ce3f522f5dc5bb72dd21b542f /source/creator | |
parent | e51c721315a5fc9c2132fb728e4da47ba5603c42 (diff) |
Cleanup: Fix build warning on windows
MSBuild on windows currently spews a warning about
buildinfo.h_fake not being generated.
For build info we use a non existing file to trigger a
custom_command on every build, which has worked well for
years now, however in recent versions of MSBuild it has
started issuing warnings about files that should be
generated but are not.
CMake is actually aware of this being a problem and states
in the documentation that "If the output of the custom command
is not actually created as a file on disk it should be marked
with the SYMBOLIC source file property."
This change fixes the build warning by properly marking the
buildinfo.h_fake as symbolic resolving the warning.
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index f923c834e93..b057269bb39 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -191,6 +191,12 @@ if(WITH_BUILDINFO) message(FATAL_ERROR "File \"${buildinfo_h_fake}\" found, this should never be created, remove!") endif() + # From the cmake documentation "If the output of the custom command is not actually created as a + # file on disk it should be marked with the SYMBOLIC source file property." + # + # Not doing this leads to build warnings for the not generated file on windows when using msbuild + SET_SOURCE_FILES_PROPERTIES(${buildinfo_h_fake} PROPERTIES SYMBOLIC TRUE) + # a custom target that is always built add_custom_target(buildinfo ALL DEPENDS ${buildinfo_h_fake}) |