From f950faf05e373c5d5fb62c0466cfd02f454a0dad Mon Sep 17 00:00:00 2001 From: HeliumAnt Date: Tue, 2 Jan 2024 22:57:50 +0100 Subject: [PATCH 1/5] fix windows meson build --- external/sources/luabind-0.7.1/meson.build | 6 +++++- external/sources/luabind-0.7.1/meson_options.txt | 3 ++- meson.build | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/external/sources/luabind-0.7.1/meson.build b/external/sources/luabind-0.7.1/meson.build index 92fd8e07d8..c2b1df2e22 100644 --- a/external/sources/luabind-0.7.1/meson.build +++ b/external/sources/luabind-0.7.1/meson.build @@ -25,7 +25,11 @@ if not get_option('use_prebuilt_libraries') or host_machine.system() in ['darwin else luabind = [] if get_option('debug') - deps = cxx.find_library('luabind-debug' , dirs: meson.current_source_dir()/'_Bin') + if get_option('debug_type') == 'release' + deps = cxx.find_library('luabind-debug-release', dirs: meson.current_source_dir()/'_Bin') + else + deps = cxx.find_library('luabind-debug' , dirs: meson.current_source_dir()/'_Bin') + endif else deps = cxx.find_library('luabind-release', dirs: meson.current_source_dir()/'_Bin') endif diff --git a/external/sources/luabind-0.7.1/meson_options.txt b/external/sources/luabind-0.7.1/meson_options.txt index f29961b4fa..afbd0840c0 100644 --- a/external/sources/luabind-0.7.1/meson_options.txt +++ b/external/sources/luabind-0.7.1/meson_options.txt @@ -1 +1,2 @@ -option('use_prebuilt_libraries', type: 'boolean', value: true, yield: true, description: 'On windows use the prebuilt libraries') \ No newline at end of file +option('use_prebuilt_libraries', type: 'boolean', value: true, yield: true, description: 'On windows use the prebuilt libraries') +option('debug_type', type: 'combo', choices: ['full','minimal','release'], value:'minimal', yield: true, description: 'Enable certain Debug features, that might slow down the game') \ No newline at end of file diff --git a/meson.build b/meson.build index ccb015a89b..edeb3b3752 100644 --- a/meson.build +++ b/meson.build @@ -73,6 +73,7 @@ elif compiler.get_argument_syntax()== 'msvc' message('cl detected') elfname = 'Cortex Command' extra_args += ['-D_HAS_ITERATOR_DEBUGGING=0', '-D_HAS_AUTO_PTR_ETC=1', '-bigobj'] + add_global_arguments('-D_ITERATOR_DEBUG_LEVEL=0', language:'cpp') add_project_link_arguments(['winmm.lib', 'ws2_32.lib', 'dinput8.lib', 'ddraw.lib', 'dxguid.lib', 'dsound.lib', 'dbghelp.lib'], language:'cpp') if host_machine.cpu_family() == 'x86' elfname += ' x86' From 5a580b89414e6fcae8be02d92fd83fa1154a3266 Mon Sep 17 00:00:00 2001 From: HeliumAnt Date: Tue, 2 Jan 2024 23:07:20 +0100 Subject: [PATCH 2/5] screw this, you're building luabind from source --- external/sources/luabind-0.7.1/meson.build | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/external/sources/luabind-0.7.1/meson.build b/external/sources/luabind-0.7.1/meson.build index c2b1df2e22..f9fbc6d247 100644 --- a/external/sources/luabind-0.7.1/meson.build +++ b/external/sources/luabind-0.7.1/meson.build @@ -20,21 +20,12 @@ elif cxx.get_argument_syntax() == 'msvc' cpp_options = ['cpp_std=vc++20'] endif -if not get_option('use_prebuilt_libraries') or host_machine.system() in ['darwin', 'linux'] - luabind = static_library('luabind071', luabind_src, dependencies: luabind_dependencies, include_directories:luabind_include, cpp_args:cpp_args+ luabind_args, override_options: ['warning_level=0']+ cpp_options) -else - luabind = [] - if get_option('debug') - if get_option('debug_type') == 'release' - deps = cxx.find_library('luabind-debug-release', dirs: meson.current_source_dir()/'_Bin') - else - deps = cxx.find_library('luabind-debug' , dirs: meson.current_source_dir()/'_Bin') - endif - else - deps = cxx.find_library('luabind-release', dirs: meson.current_source_dir()/'_Bin') - endif +if !get_option(debug) or get_option('debug_type') == release + lubaind_args += ['-DLUABIND_NO_ERROR_CHECKING=1'] endif +luabind = static_library('luabind071', luabind_src, dependencies: luabind_dependencies, include_directories:luabind_include, cpp_args:cpp_args+ luabind_args, override_options: ['warning_level=0']+ cpp_options) + luabind_dep = declare_dependency(link_with: luabind, dependencies: deps, include_directories: luabind_include, compile_args: luabind_args) meson.override_dependency('luabind', luabind_dep) \ No newline at end of file From fe3ff68518c08791c27e7cf57a01cba727e4c78a Mon Sep 17 00:00:00 2001 From: HeliumAnt Date: Tue, 2 Jan 2024 23:16:07 +0100 Subject: [PATCH 3/5] fix syntax errors --- external/sources/luabind-0.7.1/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external/sources/luabind-0.7.1/meson.build b/external/sources/luabind-0.7.1/meson.build index f9fbc6d247..850d386ef6 100644 --- a/external/sources/luabind-0.7.1/meson.build +++ b/external/sources/luabind-0.7.1/meson.build @@ -20,8 +20,8 @@ elif cxx.get_argument_syntax() == 'msvc' cpp_options = ['cpp_std=vc++20'] endif -if !get_option(debug) or get_option('debug_type') == release - lubaind_args += ['-DLUABIND_NO_ERROR_CHECKING=1'] +if (not get_option('debug')) or get_option('debug_type') == 'release' + luabind_args += ['-DLUABIND_NO_ERROR_CHECKING=1'] endif luabind = static_library('luabind071', luabind_src, dependencies: luabind_dependencies, include_directories:luabind_include, cpp_args:cpp_args+ luabind_args, override_options: ['warning_level=0']+ cpp_options) From cb90e320f78028d99691c2a553a46cd56fc38e5b Mon Sep 17 00:00:00 2001 From: HeliumAnt Date: Wed, 3 Jan 2024 18:00:09 +0100 Subject: [PATCH 4/5] remove external meson data path. always install data from /Data to prefix/data_install_dir/Data --- meson.build | 6 +++--- meson_options.txt | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index edeb3b3752..859528425f 100644 --- a/meson.build +++ b/meson.build @@ -247,9 +247,9 @@ base_exclude_files = [ ] if get_option('install_data') -install_subdir(get_option('cccpdatadir'), - exclude_directories:['.git', '.github', 'Metagames.rte', 'Scenes.rte'], +install_subdir('Data', + exclude_directories:['.git', '.github'], exclude_files:base_exclude_files, - install_dir:get_option('data_install_dir'), + install_dir:get_option('data_install_dir')/'Data', strip_directory:true) endif diff --git a/meson_options.txt b/meson_options.txt index 69bb703ba5..2eb8dd3319 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,4 @@ option('debug_type', type: 'combo', choices: ['full','minimal','release'], value:'minimal', description: 'Enable certain Debug features, that might slow down the game') -option('cccpdatadir', type:'string', value:'.', description: 'Path to the Cortex Command Data Repository') option('data_install_dir', type:'string', value:'share/CortexCommand', description: 'Where to install the data files relative to prefix directory') option('install_fmod', type:'boolean', value: true, description: 'Wether to install the fmod library.') option('fmod_dir', type:'string', value:'lib/CortexCommand/', description: 'Where to install the fmod library relative to prefix directory.') From e56c4c4eff02800739726f03c1c8b254bad661ca Mon Sep 17 00:00:00 2001 From: HeliumAnt Date: Wed, 3 Jan 2024 18:00:27 +0100 Subject: [PATCH 5/5] remove cross files --- meson_darwin.ini | 14 -------------- meson_win.txt | 4 ---- 2 files changed, 18 deletions(-) delete mode 100644 meson_darwin.ini delete mode 100644 meson_win.txt diff --git a/meson_darwin.ini b/meson_darwin.ini deleted file mode 100644 index 5b522a0ff4..0000000000 --- a/meson_darwin.ini +++ /dev/null @@ -1,14 +0,0 @@ -[constants] -arch = 'x86_64-apple-darwin21.4' - -[binaries] -c = 'o64-clang' -cpp = 'o64-clang++' -pkgconfig = arch + '-pkg-config' -strip = arch + '-strip' - -[host_machine] -system='darwin' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian='little' diff --git a/meson_win.txt b/meson_win.txt deleted file mode 100644 index 55fe5743b7..0000000000 --- a/meson_win.txt +++ /dev/null @@ -1,4 +0,0 @@ -[binaries] -c = 'clang-cl' -cpp = 'clang-cl' -strip = 'strip' \ No newline at end of file