Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 15s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 15s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 13s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make-Without-sqlite3 (push) Successful in 10s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake-Without-sqlite3 (push) Successful in 14s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson-Without-sqlite3 (push) Successful in 13s
39 lines
1.1 KiB
CMake
39 lines
1.1 KiB
CMake
cmake_minimum_required (VERSION 3.6)
|
|
project(auth_service LANGUAGES C)
|
|
|
|
set(CMAKE_C_STANDARD 23)
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
set(CMAKE_C_FLAGS "-ffunction-sections -fdata-sections -DMG_TLS=MG_TLS_OPENSSL")
|
|
if (APPLE)
|
|
elseif (UNIX)
|
|
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections")
|
|
endif()
|
|
|
|
include_directories(./src/lib/ ./src ${SQLite3_INCLUDE_DIRS})
|
|
|
|
FILE(GLOB SOURCES src/*.c src/lib/*.c src/file_db/*.c src/config/*.c src/api/*.c src/database/*.c src/security/*.c src/utils/*.c)
|
|
|
|
option(USE_SQLITE3 "Enable SQLite3 support" OFF)
|
|
option(USE_WERROR "Enable SQLite3 support" OFF)
|
|
|
|
if(USE_SQLITE3)
|
|
find_package(SQLite3 REQUIRED)
|
|
add_definitions(-DUSE_SQLITE3)
|
|
FILE(GLOB SOURCES src/*.c src/lib/*.c src/sqlite_db/*.c src/file_db/*.c src/config/*.c src/api/*.c src/database/*.c src/security/*.c src/utils/*.c)
|
|
endif()
|
|
|
|
if(USE_WERROR)
|
|
add_definitions(-Werror)
|
|
endif()
|
|
|
|
add_executable(
|
|
auth_service
|
|
${SOURCES}
|
|
)
|
|
|
|
if(USE_SQLITE3)
|
|
target_link_libraries(auth_service ssl crypto sqlite3 pthread)
|
|
else()
|
|
target_link_libraries(auth_service ssl crypto pthread)
|
|
endif()
|