diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2016-10-19 14:25:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-19 14:25:21 -0700 |
| commit | 94ed4be3d97c8d640a869e5864e2134ec4e7dbe4 (patch) | |
| tree | f1f957c3a39d6e48e5e007d9d23af786b20289aa | |
| parent | 2dede88deb85ef7a5f24b5e4e608069553d36a8c (diff) | |
| parent | 2dad2a8b94d5cad2354794eefaffaea3928dec1f (diff) | |
| download | vcpkg-94ed4be3d97c8d640a869e5864e2134ec4e7dbe4.tar.gz vcpkg-94ed4be3d97c8d640a869e5864e2134ec4e7dbe4.zip | |
Merge pull request #180 from barcharcraz/sqlite3_unlock
Sqlite3 unlock_notify and static build support
| -rw-r--r-- | ports/sqlite3/CMakeLists.txt | 20 | ||||
| -rw-r--r-- | ports/sqlite3/portfile.cmake | 9 |
2 files changed, 25 insertions, 4 deletions
diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt index 3d5f73a4a..760684493 100644 --- a/ports/sqlite3/CMakeLists.txt +++ b/ports/sqlite3/CMakeLists.txt @@ -2,15 +2,29 @@ cmake_minimum_required(VERSION 3.0) project(sqlite3 C) include_directories(${SOURCE}) -add_library(sqlite3 SHARED ${SOURCE}/sqlite3.c) -target_compile_definitions(sqlite3 PRIVATE $<$<CONFIG:Debug>:-DSQLITE_DEBUG> "-DSQLITE_API=__declspec(dllexport)") +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 + $<$<CONFIG:Debug>:-DSQLITE_DEBUG> + ${API} + -DSQLITE_ENABLE_RTREE + -DSQLITE_ENABLE_UNLOCK_NOTIFY + ) +target_include_directories(sqlite3 INTERFACE $<INSTALL_INTERFACE:include>) if(TRIPLET_SYSTEM_NAME MATCHES "WindowsStore") target_compile_definitions(sqlite3 PRIVATE -DSQLITE_OS_WINRT=1) endif() -install(TARGETS sqlite3 +install(TARGETS sqlite3 EXPORT sqlite3Config RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib ) install(FILES ${SOURCE}/sqlite3.h ${SOURCE}/sqlite3ext.h DESTINATION include CONFIGURATIONS Release) +install(EXPORT sqlite3Config DESTINATION share/sqlite3)
\ No newline at end of file diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake index 6918a0788..a7999b68c 100644 --- a/ports/sqlite3/portfile.cmake +++ b/ports/sqlite3/portfile.cmake @@ -1,3 +1,4 @@ +include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/sqlite-amalgamation-3150000) vcpkg_download_distfile(ARCHIVE @@ -14,8 +15,14 @@ vcpkg_configure_cmake( OPTIONS -DSOURCE=${SOURCE_PATH} ) - +vcpkg_build_cmake() vcpkg_install_cmake() +file(READ ${CURRENT_PACKAGES_DIR}/debug/share/sqlite3/sqlite3Config-debug.cmake SQLITE3_DEBUG_CONFIG) +string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" SQLITE3_DEBUG_CONFIG "${SQLITE3_DEBUG_CONFIG}") +file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3Config-debug.cmake "${SQLITE3_DEBUG_CONFIG}") + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) + file(WRITE ${CURRENT_PACKAGES_DIR}/share/sqlite3/copyright "SQLite is in the Public Domain.\nhttp://www.sqlite.org/copyright.html\n") vcpkg_copy_pdbs() |
