diff options
| author | sigman <sigman@ioupg.com> | 2017-06-08 02:48:04 +0300 |
|---|---|---|
| committer | sigman <sigman@ioupg.com> | 2017-06-08 02:48:04 +0300 |
| commit | f0605ca60a560ab1358177beec58a53068128753 (patch) | |
| tree | 8ec202a49130d57034dd706fb4eaf120f2be7a59 | |
| parent | 1831ce4bcc6f0ca18c3425563bc2de8857f30e41 (diff) | |
| download | vcpkg-f0605ca60a560ab1358177beec58a53068128753.tar.gz vcpkg-f0605ca60a560ab1358177beec58a53068128753.zip | |
[Magnum] Fix static library build
Fixes cmake scripts to build a static version of the libraries.
| -rw-r--r-- | ports/corrade/portfile.cmake | 12 | ||||
| -rw-r--r-- | ports/magnum/portfile.cmake | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/ports/corrade/portfile.cmake b/ports/corrade/portfile.cmake index 91251ea6b..2f5578b43 100644 --- a/ports/corrade/portfile.cmake +++ b/ports/corrade/portfile.cmake @@ -13,9 +13,16 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(BUILD_STATIC 1) +else() + set(BUILD_STATIC 0) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja + OPTIONS -DBUILD_STATIC=${BUILD_STATIC} # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 @@ -38,6 +45,11 @@ file(GLOB_RECURSE TO_REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) file(REMOVE ${TO_REMOVE}) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/corrade) file(RENAME ${CURRENT_PACKAGES_DIR}/share/corrade/COPYING ${CURRENT_PACKAGES_DIR}/share/corrade/copyright) diff --git a/ports/magnum/portfile.cmake b/ports/magnum/portfile.cmake index 10f9be3c5..71517c15c 100644 --- a/ports/magnum/portfile.cmake +++ b/ports/magnum/portfile.cmake @@ -11,10 +11,17 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(BUILD_STATIC 1) +else() + set(BUILD_STATIC 0) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -DWITH_SDL2APPLICATION=ON + OPTIONS -DBUILD_STATIC=${BUILD_STATIC} # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 # OPTIONS_RELEASE -DOPTIMIZE=1 # OPTIONS_DEBUG -DDEBUGGABLE=1 @@ -25,6 +32,10 @@ vcpkg_install_cmake() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/magnum) |
