Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2020-08-27 17:10:37 +0300
committerRay Molenkamp <github@lazydodo.com>2020-08-27 17:10:37 +0300
commit8a984ddd0f4b10e251339986232301c94b2dd3b3 (patch)
treea89f19f695bf620ce3f522f5dc5bb72dd21b542f
parente51c721315a5fc9c2132fb728e4da47ba5603c42 (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.
-rw-r--r--source/creator/CMakeLists.txt6
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})