Feature #1152 » 0083-Meson-Add-mariadb-fcdb-support.patch
| doc/INSTALL.meson | ||
|---|---|---|
|   Add support for svg flags features on clients where this is supported, | ||
|   currently only Qt. | ||
| fcdb (array): | ||
|   fcdb (player authentication) backends to build. | ||
|   Possible backends are sqlite3 and mariadb. | ||
|   The default is sqlite3. | ||
| Project definition file | ||
| ----------------------- | ||
| meson.build | ||
|---|---|---|
|      '-s', 'TOTAL_MEMORY=64MB', | ||
|      language : [ 'c', 'cpp']) | ||
| else | ||
|   priv_conf_data.set('HAVE_FCDB', 1) | ||
|   priv_conf_data.set('HAVE_FCDB_SQLITE3', 1) | ||
|   zlib_dep = c_compiler.find_library('z', dirs: cross_lib_path) | ||
|   if not c_compiler.has_header('zlib.h', args: header_arg) | ||
|     error('Mandatory header zlib.h not found!') | ||
| ... | ... | |
| endif | ||
| if emscripten | ||
|   sqlite3_dep = [] | ||
|   sqlite3_src = [] | ||
|   curl_dep = [] | ||
|   m_dep = [] | ||
| else | ||
|   sqlite3_dep = c_compiler.find_library('sqlite3', dirs: cross_lib_path) | ||
|   sqlite3_src = [ | ||
|     'dependencies/luasql/src/luasql.c', | ||
|     'dependencies/luasql/src/ls_sqlite3.c', | ||
|   ] | ||
|   curl_dep = c_compiler.find_library('curl', dirs: cross_lib_path) | ||
|   m_dep = c_compiler.find_library('m', dirs: cross_lib_path) | ||
| endif | ||
| ... | ... | |
|   endif | ||
| endif | ||
| if not emscripten | ||
|   sqlite3_dep = c_compiler.find_library('sqlite3', dirs: cross_lib_path) | ||
| else | ||
|   sqlite3_dep = [] | ||
| endif | ||
| fcdb = false | ||
| fcdb_src = [] | ||
| fcdb_dep = [] | ||
| if get_option('fcdb').contains('sqlite3') | ||
|   fcdb = true | ||
|   priv_conf_data.set('HAVE_FCDB_SQLITE3', 1) | ||
|   fcdb_src = [ fcdb_src, | ||
|     'dependencies/luasql/src/ls_sqlite3.c', | ||
|   ] | ||
|   fcdb_dep = [ fcdb_dep, sqlite3_dep ] | ||
| endif | ||
| if get_option('fcdb').contains('mariadb') | ||
|   fcdb = true | ||
|   priv_conf_data.set('HAVE_FCDB_MYSQL', 1) | ||
|   fcdb_src = [ fcdb_src, | ||
|     'dependencies/luasql/src/ls_mysql.c', | ||
|   ] | ||
|   fcdb_dep = [ fcdb_dep, dependency('mariadb') ] | ||
| endif | ||
| if fcdb | ||
|   if emscripten | ||
|     error('FCDB not supported on emscripten builds.') | ||
|   endif | ||
|   priv_conf_data.set('HAVE_FCDB', 1) | ||
|   fcdb_src = [ 'dependencies/luasql/src/luasql.c', fcdb_src ] | ||
| endif | ||
| if get_option('gitrev') | ||
|   priv_conf_data.set('GITREV', 1) | ||
| endif | ||
| ... | ... | |
|   'dependencies/tolua-5.2/src/lib/tolua_map.c', | ||
|   'dependencies/tolua-5.2/src/lib/tolua_push.c', | ||
|   'dependencies/tolua-5.2/src/lib/tolua_to.c', | ||
|   sqlite3_src, tinycthr_files, | ||
|   fcdb_src, tinycthr_files, | ||
|   sources: [verhdr], | ||
|   include_directories : common_inc, | ||
|   dependencies: lua_dep | ||
|   dependencies: [ lua_dep, fcdb_dep ] | ||
|   ) | ||
| if meson.is_cross_build() or get_option('sys-tolua-cmd') | ||
| ... | ... | |
|             tolua_com_a, tolua_com_z, tolua_game, tolua_signal], | ||
|   link_whole: fc_deps, | ||
|   dependencies: [zlib_dep, | ||
|                  curl_dep, m_dep, sqlite3_dep, icu_dep, | ||
|                  curl_dep, m_dep, icu_dep, | ||
|                  net_dep, jansson_dep, lua_dep, bz2_dep, lzma_dep, zstd_dep, | ||
|                  bcrypt_lib_dep, iconv_lib_dep, | ||
|                  gettext_dep, charset_dep, mw_dep, | ||
| meson_options.txt | ||
|---|---|---|
|        type: 'string', | ||
|        value: 'python3', | ||
|        description: 'Python interpreter to use') | ||
| option('fcdb', | ||
|        type: 'array', | ||
|        choices: ['sqlite3','mariadb'], | ||
|        value: ['sqlite3'], | ||
|        description: 'fcdb (player authentication) backends to build') | ||
| platforms/emscripten/emsbuild.sh | ||
|---|---|---|
|      -Dtools=[] \ | ||
|      -Dclients=stub,sdl2 \ | ||
|      -Dfcmp=[] \ | ||
|      -Dfcdb=[] \ | ||
|      "${PLATFORM_ROOT}/../../" | ||
| then | ||
|   echo "Setup with meson failed!" >&2 | ||