Skip to content

Commit

Permalink
[libusb] Fix pc file for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Jul 27, 2023
1 parent b954430 commit 4d8c570
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ports/libusb/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ vcpkg_from_github(
)

function(replace_runtime_library PROJ_FILE)
if (VCPKG_CRT_LINKAGE STREQUAL static)
if(VCPKG_CRT_LINKAGE STREQUAL "static")
file(READ "${PROJ_FILE}" PROJ_CONTENT)
string(REPLACE "<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>" "<RuntimeLibrary>MultiThreaded</RuntimeLibrary>" PROJ_CONTENT "${PROJ_CONTENT}")
string(REPLACE "<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>" "<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>" PROJ_CONTENT "${PROJ_CONTENT}")
Expand Down Expand Up @@ -50,9 +50,11 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
set(libdir [[${prefix}/lib]])
set(includedir [[${prefix}/include]])
configure_file("${SOURCE_PATH}/libusb-1.0.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libusb-1.0.pc" @ONLY)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libusb-1.0.pc" " -lusb-1.0" " -llibusb-1.0")
if(NOT VCPKG_BUILD_TYPE)
set(includedir [[${prefix}/../include]])
configure_file("${SOURCE_PATH}/libusb-1.0.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libusb-1.0.pc" @ONLY)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libusb-1.0.pc" " -lusb-1.0" " -llibusb-1.0")
endif()
else()
vcpkg_configure_make(
Expand Down
1 change: 1 addition & 0 deletions ports/libusb/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libusb",
"version": "1.0.26.11791",
"port-version": 1,
"description": "a cross-platform library to access USB devices",
"homepage": "https://github.com/libusb/libusb",
"license": "LGPL-2.1-or-later",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4726,7 +4726,7 @@
},
"libusb": {
"baseline": "1.0.26.11791",
"port-version": 0
"port-version": 1
},
"libusb-win32": {
"baseline": "1.2.6.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libusb.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "653d47743e90abaa28a3d17b49fe479a0096f8ef",
"version": "1.0.26.11791",
"port-version": 1
},
{
"git-tree": "230bacd99c77786d65d0cfe9ba51ec472521c382",
"version": "1.0.26.11791",
Expand Down

0 comments on commit 4d8c570

Please sign in to comment.