mindspore/cmake/external_libs/sqlite.cmake

42 lines
1.4 KiB
CMake
Raw Normal View History

2021-01-23 20:20:31 +08:00
if(ENABLE_GITEE)
set(REQ_URL "https://gitee.com/mirrors/sqlite/repository/archive/version-3.32.2.tar.gz")
2020-10-21 19:16:22 +08:00
set(MD5 "7312cad1739d8a73b14abddc850c0afa")
else()
set(REQ_URL "https://github.com/sqlite/sqlite/archive/version-3.32.2.tar.gz")
set(MD5 "ea6d3b3289b4ac216fb06081a01ef101")
2021-01-23 20:20:31 +08:00
endif()
2021-01-23 20:20:31 +08:00
if(WIN32)
2020-04-15 17:36:48 +08:00
mindspore_add_pkg(sqlite
2020-06-15 14:39:25 +08:00
VER 3.32.2
2020-04-17 16:05:21 +08:00
LIBS sqlite3
2020-06-15 14:39:25 +08:00
URL https://sqlite.org/2020/sqlite-amalgamation-3320200.zip
MD5 1eccea18d248eb34c7378b2b3f63f1db
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.windows.patch001
2020-04-17 16:05:21 +08:00
CMAKE_OPTION " "
)
2021-01-23 20:20:31 +08:00
else()
set(sqlite_USE_STATIC_LIBS ON)
2020-04-15 17:36:48 +08:00
set(sqlite_CXXFLAGS)
2021-01-23 20:20:31 +08:00
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(sqlite_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 \
-O2")
2020-04-15 17:36:48 +08:00
else()
set(sqlite_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \
-D_FORTIFY_SOURCE=2 -O2")
2020-12-04 17:12:51 +08:00
set(sqlite_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack")
2020-04-15 17:36:48 +08:00
endif()
mindspore_add_pkg(sqlite
2020-06-15 14:39:25 +08:00
VER 3.32.2
LIBS sqlite3
URL ${REQ_URL}
MD5 ${MD5}
2020-06-15 14:39:25 +08:00
PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.patch001
CONFIGURE_COMMAND ./configure --enable-shared=no --disable-tcl --disable-editline --enable-json1)
2021-01-23 20:20:31 +08:00
endif()
2020-04-15 17:36:48 +08:00
2020-04-17 16:05:21 +08:00
include_directories(${sqlite_INC})
2020-04-15 17:36:48 +08:00
add_library(mindspore::sqlite ALIAS sqlite::sqlite3)