diff options
| author | Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> | 2021-05-21 09:50:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-21 00:50:11 -0700 |
| commit | 71f5a6f9fe3fc9fbd0a10604d50dea4d49fc6825 (patch) | |
| tree | fa16f0e2e80231c3afad79828917241f06e853d2 | |
| parent | 094e58f2b01a6bf257412aba433fca3e2f638be8 (diff) | |
| download | vcpkg-71f5a6f9fe3fc9fbd0a10604d50dea4d49fc6825.tar.gz vcpkg-71f5a6f9fe3fc9fbd0a10604d50dea4d49fc6825.zip | |
[getopt-win32] fix static builds (#17942)
* vcpkg_fixup_pkgconfig for allgero5
* version stuff
* Small MSbuild fixes for static builds.
* version stuff
* update baseline
* commit vcpkg.json
* version stuff
* remove blocking line
* version stuff
* fix missing preprocessor definition
* version stuff
* Update ports/getopt-win32/portfile.cmake
Apply CR changes
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
* version stuff
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
| -rw-r--r-- | ports/getopt-win32/CONTROL | 5 | ||||
| -rw-r--r-- | ports/getopt-win32/portfile.cmake | 29 | ||||
| -rw-r--r-- | ports/getopt-win32/vcpkg.json | 8 | ||||
| -rw-r--r-- | scripts/ci.baseline.txt | 1 | ||||
| -rw-r--r-- | versions/baseline.json | 2 | ||||
| -rw-r--r-- | versions/g-/getopt-win32.json | 5 |
6 files changed, 40 insertions, 10 deletions
diff --git a/ports/getopt-win32/CONTROL b/ports/getopt-win32/CONTROL deleted file mode 100644 index 5de151a79..000000000 --- a/ports/getopt-win32/CONTROL +++ /dev/null @@ -1,5 +0,0 @@ -Source: getopt-win32
-Version: 0.1
-Description: An implementation of getopt.
-Homepage: https://github.com/libimobiledevice-win32
-Supports: windows
\ No newline at end of file diff --git a/ports/getopt-win32/portfile.cmake b/ports/getopt-win32/portfile.cmake index 780cb1c5f..2e80cf943 100644 --- a/ports/getopt-win32/portfile.cmake +++ b/ports/getopt-win32/portfile.cmake @@ -2,8 +2,6 @@ if(VCPKG_CMAKE_SYSTEM_NAME) message(FATAL_ERROR "getopt-win32 only supports building on Windows Desktop")
endif()
-vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
-
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libimobiledevice-win32/getopt
@@ -12,13 +10,38 @@ vcpkg_from_github( HEAD_REF master
)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ list(APPEND OPTIONS "/p:ConfigurationType=StaticLibrary")
+else()
+ list(APPEND OPTIONS "/p:ConfigurationType=DynamicLibrary")
+endif()
+
+set(_file "${SOURCE_PATH}/getopt.vcxproj")
+file(READ "${_file}" _contents)
+if(VCPKG_CRT_LINKAGE STREQUAL static)
+ string(REPLACE "<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>" "<RuntimeLibrary>MultiThreaded</RuntimeLibrary>" _contents "${_contents}")
+ string(REPLACE "<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>" "<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>" _contents "${_contents}")
+else()
+ string(REPLACE "<RuntimeLibrary>MultiThreaded</RuntimeLibrary>" "<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>" _contents "${_contents}")
+ string(REPLACE "<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>" "<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>" _contents "${_contents}")
+endif()
+file(WRITE "${_file}" "${_contents}")
+
+
+
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH getopt.vcxproj
LICENSE_SUBPATH LICENSE
+ OPTIONS ${OPTIONS}
)
# Copy header
-file(COPY ${SOURCE_PATH}/getopt.h DESTINATION ${CURRENT_PACKAGES_DIR}/include/)
+file(COPY "${SOURCE_PATH}/getopt.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/")
+if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/getopt.h"
+ " #define __GETOPT_H_" " #define __GETOPT_H_\n #define STATIC_GETOPT"
+ )
+endif()
set(VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS enabled)
diff --git a/ports/getopt-win32/vcpkg.json b/ports/getopt-win32/vcpkg.json new file mode 100644 index 000000000..8f68d57f2 --- /dev/null +++ b/ports/getopt-win32/vcpkg.json @@ -0,0 +1,8 @@ +{ + "name": "getopt-win32", + "version-string": "0.1", + "port-version": 1, + "description": "An implementation of getopt.", + "homepage": "https://github.com/libimobiledevice-win32", + "supports": "windows" +} diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 330aa3835..27000bc03 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -385,7 +385,6 @@ getopt-win32:arm-uwp=fail getopt-win32:x64-linux=fail getopt-win32:x64-osx=fail getopt-win32:x64-uwp=fail -getopt-win32:x64-windows-static=fail gflags:arm-uwp=fail gflags:x64-uwp=fail diff --git a/versions/baseline.json b/versions/baseline.json index 01cdff6c7..a7faa613c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2226,7 +2226,7 @@ }, "getopt-win32": { "baseline": "0.1", - "port-version": 0 + "port-version": 1 }, "gettext": { "baseline": "0.21", diff --git a/versions/g-/getopt-win32.json b/versions/g-/getopt-win32.json index 91f3a4c7d..890684207 100644 --- a/versions/g-/getopt-win32.json +++ b/versions/g-/getopt-win32.json @@ -1,6 +1,11 @@ { "versions": [ { + "git-tree": "d4b235f13a89dbec23f09caa05c7b71c176cfab8", + "version-string": "0.1", + "port-version": 1 + }, + { "git-tree": "f54e92c884b42be2395cb2c5929785cb2db8ad9b", "version-string": "0.1", "port-version": 0 |
