aboutsummaryrefslogtreecommitdiff
path: root/ports/curl
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2019-06-26 11:49:39 -0700
committerGitHub <noreply@github.com>2019-06-26 11:49:39 -0700
commitdb0c6043dcee80bbdbea6a320525f5fcf0b7dbda (patch)
tree53657929cf155d9118126ceae156abc62afbd926 /ports/curl
parent7a3818f575fadf1ded97244f803930fe2464f190 (diff)
downloadvcpkg-db0c6043dcee80bbdbea6a320525f5fcf0b7dbda.tar.gz
vcpkg-db0c6043dcee80bbdbea6a320525f5fcf0b7dbda.zip
[curl] Revert revert of `-imp` suffix removal. (#6698)
* [curl] Revert revert of `-imp` suffix removal. * [idevicerestore][libideviceactivation] Simplify dependency on curl * [curl] Trivial change to provoke rebuild
Diffstat (limited to 'ports/curl')
-rw-r--r--ports/curl/0005_remove_imp_suffix.patch13
-rw-r--r--ports/curl/portfile.cmake11
2 files changed, 22 insertions, 2 deletions
diff --git a/ports/curl/0005_remove_imp_suffix.patch b/ports/curl/0005_remove_imp_suffix.patch
new file mode 100644
index 000000000..356af2d52
--- /dev/null
+++ b/ports/curl/0005_remove_imp_suffix.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index eca9a8a..6f72955 100644
+--- a/lib/CMakeLists.txt
++++ b/lib/CMakeLists.txt
+@@ -97,7 +97,7 @@ endif()
+ set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
+ set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "")
+
+-if(WIN32)
++if(WIN32 AND 0)
+ if(BUILD_SHARED_LIBS)
+ # Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib"
+ set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake
index 5366fe88c..091fe9205 100644
--- a/ports/curl/portfile.cmake
+++ b/ports/curl/portfile.cmake
@@ -11,6 +11,7 @@ vcpkg_from_github(
0002_fix_uwp.patch
0003_fix_libraries.patch
0004_nghttp2_staticlib.patch
+ 0005_remove_imp_suffix.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB)
@@ -140,17 +141,23 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/curl${EXECUTABLE_SUFFIX}")
endif()
endif()
+if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/libcurl_imp.lib OR EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/libcurl-d_imp.lib)
+ # Because vcpkg only ever installs one or the other, there is no need to have the libraries be different names.
+ # Using the same name improves compatibility, because downstream projects can always rely on "libcurl.lib"
+ message(FATAL_ERROR "Curl's import library name should be consistent with the static library name.")
+endif()
+
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
-if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
else()
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/curl-config ${CURRENT_PACKAGES_DIR}/debug/bin/curl-config)
endif()
file(READ ${CURRENT_PACKAGES_DIR}/include/curl/curl.h CURL_H)
-if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "#ifdef CURL_STATICLIB" "#if 1" CURL_H "${CURL_H}")
else()
string(REPLACE "#ifdef CURL_STATICLIB" "#if 0" CURL_H "${CURL_H}")