added static build support to sqlite

more static support

more sqlite changes

finally done with sqlite static
This commit is contained in:
Charles Barto 2016-10-18 16:09:04 -04:00
parent 20a9bb8acb
commit 035952b242
2 changed files with 12 additions and 3 deletions

View File

@ -2,9 +2,17 @@ cmake_minimum_required(VERSION 3.0)
project(sqlite3 C) project(sqlite3 C)
include_directories(${SOURCE}) include_directories(${SOURCE})
add_library(sqlite3 SHARED ${SOURCE}/sqlite3.c) if(BUILD_SHARED_LIBS)
set(API "-DSQLITE_API=__declspec(dllexport)")
else()
set(API "-DSQLITE_API=extern")
endif()
add_library(sqlite3 ${SOURCE}/sqlite3.c)
target_compile_definitions(sqlite3 PRIVATE target_compile_definitions(sqlite3 PRIVATE
$<$<CONFIG:Debug>:-DSQLITE_DEBUG> "-DSQLITE_API=__declspec(dllexport)" $<$<CONFIG:Debug>:-DSQLITE_DEBUG>
${API}
-DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_RTREE
-DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_ENABLE_UNLOCK_NOTIFY
) )

View File

@ -1,3 +1,4 @@
include(${CMAKE_TRIPLET_FILE})
include(vcpkg_common_functions) include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000)
vcpkg_download_distfile(ARCHIVE vcpkg_download_distfile(ARCHIVE
@ -14,7 +15,7 @@ vcpkg_configure_cmake(
OPTIONS OPTIONS
-DSOURCE=${SOURCE_PATH} -DSOURCE=${SOURCE_PATH}
) )
vcpkg_build_cmake()
vcpkg_install_cmake() vcpkg_install_cmake()
file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n")