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.5 kB

5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. if(ENABLE_GITEE)
  2. set(REQ_URL "https://gitee.com/mirrors/sqlite/repository/archive/version-3.32.2.tar.gz")
  3. set(MD5 "7312cad1739d8a73b14abddc850c0afa")
  4. else()
  5. set(REQ_URL "https://github.com/sqlite/sqlite/archive/version-3.32.2.tar.gz")
  6. set(MD5 "ea6d3b3289b4ac216fb06081a01ef101")
  7. endif()
  8. if(WIN32)
  9. mindspore_add_pkg(sqlite
  10. VER 3.32.2
  11. LIBS sqlite3
  12. URL https://sqlite.org/2020/sqlite-amalgamation-3320200.zip
  13. MD5 1eccea18d248eb34c7378b2b3f63f1db
  14. PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.windows.patch001
  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.32.2
  30. LIBS sqlite3
  31. URL ${REQ_URL}
  32. MD5 ${MD5}
  33. PATCHES ${CMAKE_SOURCE_DIR}/third_party/patch/sqlite/sqlite.patch001
  34. CONFIGURE_COMMAND ./configure --enable-shared=no --disable-tcl --disable-editline --enable-json1)
  35. endif()
  36. include_directories(${sqlite_INC})
  37. add_library(mindspore::sqlite ALIAS sqlite::sqlite3)