[ODBC-55] Build with dynamic library (in CmakeLists.txt) Created: 2016-09-27  Updated: 2017-08-25  Resolved: 2017-08-25

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: None
Affects Version/s: 2.0.12
Fix Version/s: 3.0.2

Type: Bug Priority: Major
Reporter: Michal Schorm Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

Fedora24


Issue Links:
Duplicate
is duplicated by ODBC-81 dynamically link with client library Closed
is duplicated by ODBC-98 Connector ODBC can't be built with dy... Closed

 Description   

Hello, I'm trying to pack and distribute odbc-connector to Fedora repos.

But there is a issue with static lib, since there can't be any in Fedora (if posssible).
But hey, i have a workaround! Just make it optional to build it with dynamic library instead.

Edit file CMakeLists.txt on line 211 and add following:

IF(MARIADB_DYNAMIC_LIB)
  SET(MARIADB_LIB ${MARIADB_DYNAMIC_LIB})
ENDIF()

Now I can build it safely with

cmake ./ -DMARIADB_DYNAMIC_LIB="/usr/lib64mariadb/libmariadb.so"

and you will not lose any functionality.



 Comments   
Comment by Lawrin Novitsky [ 2017-08-25 ]

Cmake option MARIADB_LINK_DYNAMIC tells cmake to look for and configure to link against dynamic library. The same old MARIADB_LIBRARY_DIR option in combination with it, can be used to point to library dir. The fix is for 3.0 only, and there is no plans to downmerge it.
One more thing is that that on *nix cmake will look for libmariadb.so.3, as only C/C 3.0 works for C/ODBC 3.0
Commit 2569534eabed444f49c008ca2fdb896cd769b9c1
Obviously, it also removes last references of not-exported c/c symbols.

Generated at Thu Feb 08 03:25:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.