aboutsummaryrefslogtreecommitdiff
path: root/project/cmake/scripts/windows/macros.cmake
diff options
context:
space:
mode:
authorChristian Fetzer <fetzer.ch@gmail.com>2016-04-03 12:16:42 +0200
committerChristian Fetzer <fetzer.ch@gmail.com>2016-04-03 13:00:34 +0200
commit1a971f06bbc49c719fb3d274899991c888777ad6 (patch)
tree91c5f98cfaecde0dc54f996602aa4487a02259a0 /project/cmake/scripts/windows/macros.cmake
parent5335d1013a69328f0e26ee8b6037b1ace4cf1063 (diff)
[cmake] Fix compilation with msbuild (vs2015)
The CMake VS2015 generator sets the /Fd parameter (program database file name) to <targetname>.pdb while the VS2014 generator used vc140.pdb. Since we use precompiled headers over multiple static libraries we have to use one single pdb file. This fixes the errors: fatal error C1083: Cannot open precompiled header file: 'C:/jenkins/slave/workspace/WIN-32/kodi-build/Release/objs/kodi.pch': No such file or directory See https://github.com/fetzerch/xbmc/commit/f626edf87a5af6c1f10d13d2d3b8103d6c2aadd1 for more information.
Diffstat (limited to 'project/cmake/scripts/windows/macros.cmake')
-rw-r--r--project/cmake/scripts/windows/macros.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/project/cmake/scripts/windows/macros.cmake b/project/cmake/scripts/windows/macros.cmake
index 6aabf7d5a8..2b61875182 100644
--- a/project/cmake/scripts/windows/macros.cmake
+++ b/project/cmake/scripts/windows/macros.cmake
@@ -87,11 +87,13 @@ function(add_precompiled_header target pch_header pch_source)
# As own target for usage in multiple libraries
if(NOT TARGET ${PCH_PCH_TARGET}_pch)
add_library(${PCH_PCH_TARGET}_pch STATIC ${pch_source})
- set_target_properties(${PCH_PCH_TARGET}_pch PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR})
+ set_target_properties(${PCH_PCH_TARGET}_pch PROPERTIES COMPILE_PDB_NAME vc140
+ COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR})
endif()
# From VS2012 onwards, precompiled headers have to be linked against (LNK2011).
target_link_libraries(${target} PUBLIC ${PCH_PCH_TARGET}_pch)
- set_target_properties(${target} PROPERTIES COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR})
+ set_target_properties(${target} PROPERTIES COMPILE_PDB_NAME vc140
+ COMPILE_PDB_OUTPUT_DIRECTORY ${PRECOMPILEDHEADER_DIR})
else()
# As part of the target
target_sources(${target} PRIVATE ${pch_source})