mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Add SQLite to build system and CI
This commit is contained in:
parent
2eb3d23ef4
commit
ad21ec1269
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
|
@ -62,7 +62,7 @@ jobs:
|
|||
if: contains(matrix.os, 'ubuntu')
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install pkg-config cmake libfreetype6-dev libnotify-dev libsdl2-dev -y
|
||||
sudo apt-get install pkg-config cmake libfreetype6-dev libnotify-dev libsdl2-dev libsqlite3-dev -y
|
||||
|
||||
- name: Prepare Linux (fancy)
|
||||
if: contains(matrix.os, 'ubuntu') && matrix.fancy
|
||||
|
|
45
cmake/FindSQLite3.cmake
Normal file
45
cmake/FindSQLite3.cmake
Normal file
|
@ -0,0 +1,45 @@
|
|||
if(NOT PREFER_BUNDLED_LIBS)
|
||||
set(CMAKE_MODULE_PATH ${ORIGINAL_CMAKE_MODULE_PATH})
|
||||
find_package(SQLite3)
|
||||
set(CMAKE_MODULE_PATH ${OWN_CMAKE_MODULE_PATH})
|
||||
endif()
|
||||
|
||||
if(NOT SQLite3_FOUND)
|
||||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(PC_SQLite3 sqlite3)
|
||||
endif()
|
||||
|
||||
set_extra_dirs_lib(SQLite3 sqlite3)
|
||||
find_library(SQLite3_LIBRARY
|
||||
NAMES sqlite3
|
||||
HINTS ${HINTS_SQLite3_LIBDIR} ${PC_SQLite3_LIBDIR} ${PC_SQLite3_LIBRARY_DIRS}
|
||||
PATHS ${PATHS_SQLite3_LIBDIR}
|
||||
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
||||
)
|
||||
set_extra_dirs_include(SQLite3 sqlite3 "${SQLite3_LIBRARY}")
|
||||
find_path(SQLite3_INCLUDEDIR sqlite3.h
|
||||
PATH_SUFFIXES sqlite3
|
||||
HINTS ${HINTS_SQLite3_INCLUDEDIR} ${PC_SQLite3_INCLUDEDIR} ${PC_SQLite3_INCLUDE_DIRS}
|
||||
PATHS ${PATHS_SQLite3_INCLUDEDIR}
|
||||
${CROSSCOMPILING_NO_CMAKE_SYSTEM_PATH}
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLite3_INCLUDEDIR)
|
||||
|
||||
mark_as_advanced(SQLite3_INCLUDEDIR SQLite3_LIBRARY)
|
||||
|
||||
if(SQLite3_FOUND)
|
||||
set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDEDIR})
|
||||
if(SQLite3_LIBRARY)
|
||||
set(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
|
||||
else()
|
||||
set(SQLite3_LIBRARIES)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SQLite3_FOUND)
|
||||
is_bundled(SQLite3_BUNDLED "${SQLite3_LIBRARY}")
|
||||
endif()
|
Loading…
Reference in a new issue