From 73c22c3c49f02d1db6d1c6c49fdd97bacdb5635a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 8 Apr 2021 18:54:16 +0300 Subject: [PATCH 45/45] Meson: Add option to build freeciv-web version See osdn #41948 Signed-off-by: Marko Lindqvist --- doc/INSTALL.meson | 3 +++ gen_headers/meson_freeciv_config.h.in | 3 +++ meson.build | 9 ++++++++- meson_options.txt | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson index 0a0c80206d..b2b84ee353 100644 --- a/doc/INSTALL.meson +++ b/doc/INSTALL.meson @@ -132,6 +132,9 @@ nls (boolean): gitrev (boolean): Include git commit id to the version string. +freeciv-web (boolean): + Build freeciv-web version instead of normal one. + run.sh ------ diff --git a/gen_headers/meson_freeciv_config.h.in b/gen_headers/meson_freeciv_config.h.in index e1a8128df6..a0b37c077e 100644 --- a/gen_headers/meson_freeciv_config.h.in +++ b/gen_headers/meson_freeciv_config.h.in @@ -24,6 +24,9 @@ #ifndef FC__FREECIV_CONFIG_H #define FC__FREECIV_CONFIG_H +/* Is this freeciv-web instead of regular build */ +#mesondefine FREECIV_WEB + /* Use pthreads as thread implementation */ #mesondefine FREECIV_HAVE_PTHREAD diff --git a/meson.build b/meson.build index b07d70d31c..cc33deaf5e 100644 --- a/meson.build +++ b/meson.build @@ -41,6 +41,13 @@ else add_global_arguments('-DQT_NO_DEBUG', language : 'cpp') endif +if get_option('freeciv-web') + priv_conf_data.set('FREECIV_WEB', 1) + server_binary_name = 'freeciv-web' +else + server_binary_name = 'freeciv-server' +endif + c_compiler = meson.get_compiler('c') pub_headers = [ @@ -653,7 +660,7 @@ server_lib = static_library('fc_server', dependencies: lua_dep ) -executable('freeciv-server', +executable(server_binary_name, 'server/civserver.c', include_directories: server_inc, link_with: [server_lib, common_lib, ais], diff --git a/meson_options.txt b/meson_options.txt index a8119393a8..52add61500 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -49,3 +49,8 @@ option('gitrev', type: 'boolean', value: false, description: 'Include git commit id to the version string') + +option('freeciv-web', + type: 'boolean', + value: false, + description: 'Make a freeciv-web server build instead of normal one') -- 2.30.2