aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-03-20 21:45:01 -0700
committerRobert Schumacher <roschuma@microsoft.com>2018-03-20 21:45:11 -0700
commit9e54b3792daca1898a1b751d37fa22360721eba5 (patch)
treebad4848f21568d7a7e5de1dc65d2bc420c5d5528 /scripts
parentd80dd5cbc777ce765c2d6b78d7c485fdf05f284b (diff)
downloadvcpkg-9e54b3792daca1898a1b751d37fa22360721eba5.tar.gz
vcpkg-9e54b3792daca1898a1b751d37fa22360721eba5.zip
[mpg123] Disable LTCG for static libs to avoid ABI incompatibility
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_build_msbuild.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake
index b8403d277..6da8a7369 100644
--- a/scripts/cmake/vcpkg_build_msbuild.cmake
+++ b/scripts/cmake/vcpkg_build_msbuild.cmake
@@ -87,6 +87,12 @@ function(vcpkg_build_msbuild)
/m
)
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ # Disable LTCG for static libraries because this setting introduces ABI incompatibility between minor compiler versions
+ # TODO: Add a way for the user to override this if they want to opt-in to incompatibility
+ list(APPEND _csc_OPTIONS /p:WholeProgramOptimization=false)
+ endif()
+
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)