From 89dec24cc258f78953004a3a70acf74019649736 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Tue, 7 Jul 2020 04:20:06 +0700 Subject: [PATCH] [vcpkg] Add mingw dynamic libs triplet (#12101) * Update .gitignore * Add mingw dynamic lib triplets * Only copy pdbs if not using *-mingw triplets * Using VCPKG_POLICY_DLLS_WITHOUT_LIBS as a workaround * Rename *-mingw to *-mingw-dynamic Co-authored-by: Billy Robert O'Neal --- .gitignore | 12 ++++++++---- scripts/cmake/vcpkg_copy_pdbs.cmake | 2 +- triplets/community/arm-mingw-dynamic.cmake | 7 +++++++ .../{arm-mingw.cmake => arm-mingw-static.cmake} | 0 triplets/community/arm64-mingw-dynamic.cmake | 7 +++++++ .../{arm64-mingw.cmake => arm64-mingw-static.cmake} | 0 triplets/community/x64-mingw-dynamic.cmake | 7 +++++++ .../{x64-mingw.cmake => x64-mingw-static.cmake} | 0 triplets/community/x86-mingw-dynamic.cmake | 7 +++++++ .../{x86-mingw.cmake => x86-mingw-static.cmake} | 0 10 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 triplets/community/arm-mingw-dynamic.cmake rename triplets/community/{arm-mingw.cmake => arm-mingw-static.cmake} (100%) create mode 100644 triplets/community/arm64-mingw-dynamic.cmake rename triplets/community/{arm64-mingw.cmake => arm64-mingw-static.cmake} (100%) create mode 100644 triplets/community/x64-mingw-dynamic.cmake rename triplets/community/{x64-mingw.cmake => x64-mingw-static.cmake} (100%) create mode 100644 triplets/community/x86-mingw-dynamic.cmake rename triplets/community/{x86-mingw.cmake => x86-mingw-static.cmake} (100%) diff --git a/.gitignore b/.gitignore index 273c2e4150..c3973b097d 100644 --- a/.gitignore +++ b/.gitignore @@ -295,14 +295,18 @@ __pycache__/ /toolsrc/msbuild.x64.release/ /triplets/* #add vcpkg-designed triplets back in -!triplets/community/arm64-mingw.cmake +!triplets/community/arm64-mingw-dynamic.cmake +!triplets/community/arm64-mingw-static.cmake !triplets/community/arm64-uwp.cmake !triplets/community/arm64-windows-static.cmake -!triplets/community/arm-mingw.cmake +!triplets/community/arm-mingw-dynamic.cmake +!triplets/community/arm-mingw-static.cmake !triplets/community/arm-windows.cmake -!triplets/community/x64-mingw.cmake +!triplets/community/x64-mingw-dynamic.cmake +!triplets/community/x64-mingw-static.cmake !triplets/community/x64-windows-static-md.cmake -!triplets/community/x86-mingw.cmake +!triplets/community/x86-mingw-dynamic.cmake +!triplets/community/x86-mingw-static.cmake !triplets/community/x86-uwp.cmake !triplets/community/x86-windows-static.cmake !triplets/community/x86-windows-static-md.cmake diff --git a/scripts/cmake/vcpkg_copy_pdbs.cmake b/scripts/cmake/vcpkg_copy_pdbs.cmake index 4e9f642b5b..12154d91c4 100644 --- a/scripts/cmake/vcpkg_copy_pdbs.cmake +++ b/scripts/cmake/vcpkg_copy_pdbs.cmake @@ -39,7 +39,7 @@ function(vcpkg_copy_pdbs) set(${OUTVAR} ${MSG} PARENT_SCOPE) endfunction() - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic AND NOT VCPKG_TARGET_IS_MINGW) file(GLOB_RECURSE DLLS ${_vcp_BUILD_PATHS}) set(DLLS_WITHOUT_MATCHING_PDBS) diff --git a/triplets/community/arm-mingw-dynamic.cmake b/triplets/community/arm-mingw-dynamic.cmake new file mode 100644 index 0000000000..b23870c11a --- /dev/null +++ b/triplets/community/arm-mingw-dynamic.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE arm) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) +set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) diff --git a/triplets/community/arm-mingw.cmake b/triplets/community/arm-mingw-static.cmake similarity index 100% rename from triplets/community/arm-mingw.cmake rename to triplets/community/arm-mingw-static.cmake diff --git a/triplets/community/arm64-mingw-dynamic.cmake b/triplets/community/arm64-mingw-dynamic.cmake new file mode 100644 index 0000000000..30ed204ed7 --- /dev/null +++ b/triplets/community/arm64-mingw-dynamic.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) +set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) diff --git a/triplets/community/arm64-mingw.cmake b/triplets/community/arm64-mingw-static.cmake similarity index 100% rename from triplets/community/arm64-mingw.cmake rename to triplets/community/arm64-mingw-static.cmake diff --git a/triplets/community/x64-mingw-dynamic.cmake b/triplets/community/x64-mingw-dynamic.cmake new file mode 100644 index 0000000000..1f132cfe15 --- /dev/null +++ b/triplets/community/x64-mingw-dynamic.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) +set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) diff --git a/triplets/community/x64-mingw.cmake b/triplets/community/x64-mingw-static.cmake similarity index 100% rename from triplets/community/x64-mingw.cmake rename to triplets/community/x64-mingw-static.cmake diff --git a/triplets/community/x86-mingw-dynamic.cmake b/triplets/community/x86-mingw-dynamic.cmake new file mode 100644 index 0000000000..000b36d960 --- /dev/null +++ b/triplets/community/x86-mingw-dynamic.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_ENV_PASSTHROUGH PATH) + +set(VCPKG_CMAKE_SYSTEM_NAME MinGW) +set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled) diff --git a/triplets/community/x86-mingw.cmake b/triplets/community/x86-mingw-static.cmake similarity index 100% rename from triplets/community/x86-mingw.cmake rename to triplets/community/x86-mingw-static.cmake