1 Star 3 Fork 1

黃正雄 / 思库可思 sqxclib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
meson.build 3.95 KB
一键复制 编辑 原始数据 按行查看 历史
黃正雄 提交于 2023-07-06 08:00 . bump version to 0.11
# Don't specify version of the C or C++ language standard for user.
# Note: sqxclib code still compile with C99 and C++11 currently.
project('sqxclib',
'c', 'cpp',
default_options : [
# 'c_std=c99',
# 'cpp_std=c++11',
],
version: '0.11'
)
# add_project_arguments('-DHAVE_CONFIG_H', language : ['c', 'cpp'])
# add_project_arguments('-DNDEBUG', language : ['c', 'cpp'])
sqxclib_version = meson.project_version()
sqxclib_soversion = 0
config_data = configuration_data()
# --- thread ---
config_data.set('SQXCLIB_HAVE_THREAD', '0')
#if host_machine.system() == 'windows'
# config_data.set('SQXCLIB_HAVE_THREAD', '1')
#else
# thread = dependency('threads', required: false)
# if thread.found() == true
# config_data.set('SQXCLIB_HAVE_THREAD', '1')
# else
# config_data.set('SQXCLIB_HAVE_THREAD', '0')
# endif
#endif
# --- json-c ---
jsonc = dependency('json-c', required: false)
if jsonc.found() == true
config_data.set('SQXCLIB_HAVE_JSONC', '1')
else
config_data.set('SQXCLIB_HAVE_JSONC', '0')
endif
# --- SQLite ---
sqlite = dependency('sqlite3', required: false)
if sqlite.found() == true
config_data.set('SQXCLIB_HAVE_SQLITE', '1')
else
config_data.set('SQXCLIB_HAVE_SQLITE', '0')
endif
# --- MySQL, MariaDB ---
mariadb_pc_found = false
mysqlclient_pc_found = false
mysql = dependency('mysqlclient', required: false)
if mysql.found() == true
mysqlclient_pc_found = true
config_data.set('SQXCLIB_HAVE_MYSQL', '1')
else
mysql = dependency('mariadb', required: false)
if mysql.found() == true
mariadb_pc_found = true
config_data.set('SQXCLIB_HAVE_MYSQL', '1')
endif
endif
# find MySQL if mysqlclient.pc (or mariadb.pc) not found
if mysql.found() == false
mysql_config = find_program('mysql_config', required: false)
if mysql_config.found() == false
mysql_config = find_program('mariadb_config', required: false)
endif
if mysql_config.found() == true
mysql = declare_dependency(compile_args: run_command([mysql_config, '--cflags']).stdout().split(),
link_args: run_command([mysql_config, '--libs']).stdout().split() )
config_data.set('SQXCLIB_HAVE_MYSQL', '1')
else
config_data.set('SQXCLIB_HAVE_MYSQL', '0')
endif
endif
# --- PostgreSQL ---
postgresql = dependency('libpq', required: false)
if postgresql.found() == true
config_data.set('SQXCLIB_HAVE_POSTGRESQL', '1')
else
config_data.set('SQXCLIB_HAVE_POSTGRESQL', '0')
endif
# --- pkg-config metadata file --- share/pkgconfig/sqxclib.pc
config_data.set('SQXCLIB_PC_PREFIX', get_option('prefix'))
config_data.set('SQXCLIB_PC_VERSION', sqxclib_version)
config_data.set('SQXCLIB_PC_REQUIRE_JSONC', '')
config_data.set('SQXCLIB_PC_REQUIRE_SQLITE', '')
config_data.set('SQXCLIB_PC_REQUIRE_MYSQL', '')
config_data.set('SQXCLIB_PC_REQUIRE_POSTGRESQL', '')
if jsonc.found() == true
config_data.set('SQXCLIB_PC_REQUIRE_JSONC', 'json-c')
endif
if sqlite.found() == true
config_data.set('SQXCLIB_PC_REQUIRE_SQLITE', 'sqlite3')
config_data.set('SQXCLIB_PC_LIB_SQLITE', '-lsqxc_sqlite')
endif
if mysql.found() == true
# MySQL pkg-config name: mysqlclient or mariadb
if mysqlclient_pc_found == true
config_data.set('SQXCLIB_PC_REQUIRE_MYSQL', 'mysqlclient')
elif mariadb_pc_found == true
config_data.set('SQXCLIB_PC_REQUIRE_MYSQL', 'mariadb')
endif
config_data.set('SQXCLIB_PC_LIB_MYSQL', '-lsqxc_mysql')
endif
if postgresql.found() == true
config_data.set('SQXCLIB_PC_REQUIRE_POSTGRESQL', 'libpq')
config_data.set('SQXCLIB_PC_LIB_POSTGRESQL', '-lsqxc_postgre')
endif
# has c++ compiler
config_data.set('SQXCLIB_PC_LIB_CXX', '-lsqxcpp')
configure_file(input : 'sqxclib.pc.in',
output : 'sqxclib.pc',
install : true,
install_dir : get_option('datadir') / 'pkgconfig',
configuration : config_data)
# install project-template
install_subdir('project-template', install_dir : get_option('datadir') / 'sqxclib')
# --- subdirectory ---
subdir('sqxc')
subdir('sqxcsupport')
subdir('sqxcapp')
subdir('tests')
subdir('examples')
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C/C++
1
https://gitee.com/chhuang-one/sqxclib.git
git@gitee.com:chhuang-one/sqxclib.git
chhuang-one
sqxclib
思库可思 sqxclib
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891