Skip to content

Commit

Permalink
[mysql-connector-cpp] Fix static lib name for MSVC (#42612)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Dec 12, 2024
1 parent 6c42b86 commit 3c5b9b4
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 12 deletions.
20 changes: 10 additions & 10 deletions ports/mysql-connector-cpp/depfindprotobuf.diff
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
diff --git a/cdk/cmake/DepFindProtobuf.cmake b/cdk/cmake/DepFindProtobuf.cmake
index 1fc785e..d9eaecc 100644
index 1fc785e..2ba7e99 100644
--- a/cdk/cmake/DepFindProtobuf.cmake
+++ b/cdk/cmake/DepFindProtobuf.cmake
@@ -45,8 +45,6 @@
@@ -44,9 +44,9 @@
#
#

if(TARGET ext::protobuf)
- return()
-if(TARGET ext::protobuf)
+if(COMMAND mysqlx_protobuf_generate_cpp)
return()
-endif()
+elseif(0)

message(STATUS "Setting up Protobuf.")

@@ -65,6 +63,10 @@ add_ext_targets(protobuf
EXECUTABLE protoc pb_protoc
@@ -66,6 +66,7 @@ add_ext_targets(protobuf
)

+endif()
+if(COMMAND mysqlx_protobuf_generate_cpp)
+ return()
+endif()

+endif()
# Standard PROTOBUF_GENERATE_CPP modified to our usage
function(mysqlx_protobuf_generate_cpp SRCS HDRS)
IF(NOT ARGN)
26 changes: 26 additions & 0 deletions ports/mysql-connector-cpp/lib-name-static.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/install_layout.cmake b/install_layout.cmake
index 4a8a511..ee091da 100644
--- a/install_layout.cmake
+++ b/install_layout.cmake
@@ -219,7 +219,7 @@ set(LIB_NAME_BASE "mysqlcppconnx")
set(LIB_NAME_STATIC "${LIB_NAME_BASE}-static")

if(WIN32 AND STATIC_MSVCRT)
- set(LIB_NAME_STATIC "${LIB_NAME}-mt")
+ set(LIB_NAME_STATIC "${LIB_NAME_STATIC}-mt")
endif()

if(BUILD_STATIC)
diff --git a/jdbc/install_layout.cmake b/jdbc/install_layout.cmake
index e9e15a5..a4f7dc0 100644
--- a/jdbc/install_layout.cmake
+++ b/jdbc/install_layout.cmake
@@ -91,7 +91,7 @@ set(LIB_NAME_BASE "mysqlcppconn")
set(LIB_NAME_STATIC "${LIB_NAME_BASE}-static")

if(WIN32 AND STATIC_MSVCRT)
- set(LIB_NAME_STATIC "${LIB_NAME}-mt")
+ set(LIB_NAME_STATIC "${LIB_NAME_STATIC}-mt")
endif()

if(BUILD_STATIC)
1 change: 1 addition & 0 deletions ports/mysql-connector-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ vcpkg_from_github(
depfindprotobuf.diff
disable-telemetry.diff
dont-preload-cache.diff
lib-name-static.diff
merge-archives.diff
save-linker-opts.diff
export-targets.patch
Expand Down
2 changes: 1 addition & 1 deletion ports/mysql-connector-cpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mysql-connector-cpp",
"version": "9.1.0",
"port-version": 2,
"port-version": 3,
"description": "This is a release of MySQL Connector/C++, the C++ interface for communicating with MySQL servers.",
"homepage": "https://github.com/mysql/mysql-connector-cpp",
"license": null,
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6218,7 +6218,7 @@
},
"mysql-connector-cpp": {
"baseline": "9.1.0",
"port-version": 2
"port-version": 3
},
"nameof": {
"baseline": "0.10.4",
Expand Down
5 changes: 5 additions & 0 deletions versions/m-/mysql-connector-cpp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bdd83a314ef53b655567e07757c328eb33694315",
"version": "9.1.0",
"port-version": 3
},
{
"git-tree": "30acb048f76e9b63cfd210aa612d7a1bbcc447a3",
"version": "9.1.0",
Expand Down

0 comments on commit 3c5b9b4

Please sign in to comment.