You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

sqlite.cmake 1.4 kB

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