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
94 lines
2.7 KiB
Meson
94 lines
2.7 KiB
Meson
project('auth_service', 'c', default_options: ['c_std=gnu2x'])
|
|
include_dirs = include_directories('src', 'src/lib')
|
|
deps = [dependency('openssl')]
|
|
extra_c_args = ['-ffunction-sections', '-fdata-sections', '-DMG_TLS=MG_TLS_OPENSSL']
|
|
extra_c_link_args = []
|
|
system = host_machine.system()
|
|
if system == 'linux'
|
|
extra_c_link_args += ['-Wl,--gc-sections']
|
|
endif
|
|
|
|
sqlite3_dep = dependency('sqlite3', required: false)
|
|
use_sqlite3 = get_option('use_sqlite3')
|
|
use_werror = get_option('use_werror')
|
|
sources = [
|
|
'src/main.c',
|
|
'src/api/user.c',
|
|
'src/api/add_user.c',
|
|
'src/api/change_password.c',
|
|
'src/api/change_user.c',
|
|
'src/api/delete_user.c',
|
|
'src/api/get_all_users.c',
|
|
'src/api/get_token.c',
|
|
'src/api/get_user.c',
|
|
'src/api/register_user.c',
|
|
'src/api/verify_token.c',
|
|
'src/utils/utils.c',
|
|
'src/security/jwt.c',
|
|
'src/lib/mongoose.c',
|
|
'src/lib/cJSON.c',
|
|
'src/database/database.c',
|
|
'src/database/db_get_all_users.c',
|
|
'src/database/db_get_user_by_username.c',
|
|
'src/database/db_get_users_from_file.c',
|
|
'src/utils/file.c',
|
|
'src/database/db_insert_user.c',
|
|
'src/database/db_update_user.c',
|
|
'src/database/db_delete_user.c',
|
|
'src/database/db_get_user_by_id.c',
|
|
'src/config/ConfigManager.c',
|
|
'src/config/config.c',
|
|
'src/api/static.c',
|
|
'src/security/cors.c',
|
|
'src/database/db_get_user_field_by_id.c',
|
|
'src/database/db_update_user_field.c',
|
|
]
|
|
|
|
with_filedb_sources = [
|
|
'src/file_db/filedb.c',
|
|
'src/file_db/filedb_delete_user.c',
|
|
'src/file_db/filedb_get_all_users.c',
|
|
'src/file_db/filedb_get_user_by_id.c',
|
|
'src/file_db/filedb_get_user_by_username.c',
|
|
'src/file_db/filedb_get_user_field_by_id.c',
|
|
'src/file_db/filedb_insert_user.c',
|
|
'src/file_db/filedb_update_user.c',
|
|
'src/file_db/filedb_update_user_field.c',
|
|
]
|
|
|
|
with_sqlite3_sources = [
|
|
'src/sqlite_db/sqlite.c',
|
|
'src/sqlite_db/sqlite_delete_user.c',
|
|
'src/sqlite_db/sqlite_get_all_users.c',
|
|
'src/sqlite_db/sqlite_get_user_by_id.c',
|
|
'src/sqlite_db/sqlite_get_user_by_username.c',
|
|
'src/sqlite_db/sqlite_get_user_field_by_id.c',
|
|
'src/sqlite_db/sqlite_init_db.c',
|
|
'src/sqlite_db/sqlite_insert_user.c',
|
|
'src/sqlite_db/sqlite_migrate_db.c',
|
|
'src/sqlite_db/sqlite_update_user.c',
|
|
'src/sqlite_db/sqlite_update_user_field.c',
|
|
]
|
|
|
|
if use_sqlite3
|
|
if not sqlite3_dep.found()
|
|
error('SQLite3 requested but not found')
|
|
endif
|
|
deps += sqlite3_dep
|
|
sources += with_sqlite3_sources
|
|
add_project_arguments('-DUSE_SQLITE3', language: 'c')
|
|
endif
|
|
|
|
if use_werror
|
|
add_project_arguments('-Werror', language: 'c')
|
|
endif
|
|
|
|
executable(
|
|
'auth_service',
|
|
sources + with_filedb_sources,
|
|
include_directories: include_dirs,
|
|
dependencies: deps,
|
|
c_args: extra_c_args,
|
|
link_args: extra_c_link_args,
|
|
)
|