From 8a984ddd0f4b10e251339986232301c94b2dd3b3 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Thu, 27 Aug 2020 08:10:37 -0600 Subject: 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. --- source/creator/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) 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}) -- cgit v1.2.3