1if(ENABLE_GITEE) 2 set(REQ_URL "https://gitee.com/mirrors/sqlite/repository/archive/version-3.32.2.tar.gz") 3 set(MD5 "d6e368e4fffbb3ec7c8c9b3eb094ece3") 4else() 5 set(REQ_URL "https://github.com/sqlite/sqlite/archive/version-3.32.2.tar.gz") 6 set(MD5 "ea6d3b3289b4ac216fb06081a01ef101") 7endif() 8 9 10if(WIN32) 11 mindspore_add_pkg(sqlite 12 VER 3.32.2 13 LIBS sqlite3 14 URL https://sqlite.org/2020/sqlite-amalgamation-3320200.zip 15 MD5 1eccea18d248eb34c7378b2b3f63f1db 16 PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.windows.patch001 17 CMAKE_OPTION " " 18 ) 19 20else() 21 set(sqlite_USE_STATIC_LIBS ON) 22 set(sqlite_CXXFLAGS) 23 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 24 set(sqlite_CFLAGS "-fstack-protector-all -Wno-uninitialized -Wno-unused-parameter -fPIC -D_FORTIFY_SOURCE=2 \ 25 -O2") 26 else() 27 set(sqlite_CFLAGS "-fstack-protector-all -Wno-maybe-uninitialized -Wno-unused-parameter -fPIC \ 28 -D_FORTIFY_SOURCE=2 -O2") 29 set(sqlite_LDFLAGS "-Wl,-z,relro,-z,now,-z,noexecstack") 30 endif() 31 mindspore_add_pkg(sqlite 32 VER 3.32.2 33 LIBS sqlite3 34 URL ${REQ_URL} 35 MD5 ${MD5} 36 PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.patch001 37 CONFIGURE_COMMAND ./configure --enable-shared=no --disable-tcl --disable-editline --enable-json1) 38endif() 39 40include_directories(${sqlite_INC}) 41add_library(mindspore::sqlite ALIAS sqlite::sqlite3) 42