SRombauts / SQLiteCpp

SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.
http://srombauts.github.io/SQLiteCpp
MIT License
2.19k stars 509 forks source link

it can be shared library? #463

Closed kim-com closed 4 months ago

kim-com commented 5 months ago

it can be shared library?

it describe explicity that BUILD_SHARED_LIBS is OFF if BUILD_SHARED_LIBS is on, there are proper excution for making shared library also option of add_library is auto

tenk28 commented 4 months ago

Got the same question, I build with cmake -DBUILD_SHARED_LIBS=ON -S .. You could also try add set(BUILD_SHARED_LIBS ON CACHE INTERNAL "") before adding SQLiteCpp subdirectory as in example

image

kim-com commented 4 months ago

@tenk28 thank you for replying on me. I didn't know about BUILD_SHARED_LIBS, so I change a little bit CMakefile.

SET(BUILD_SHARED_LIBS  ON CACHE BOOL "make shared library" FORCE)
...
...
if(BUILD_SHARED_LIBS)
    add_library(SQLiteCpp SHARED ${SQLITECPP_SRC} ${SQLITECPP_INC} ${SQLITECPP_DOC} ${SQLITECPP_SCRIPT})
else()
    add_library(SQLiteCpp STATIC ${SQLITECPP_SRC} ${SQLITECPP_INC} ${SQLITECPP_DOC} ${SQLITECPP_SCRIPT})
endif()