Skip to content

Commit

Permalink
Remove C compiler dependency (see The-Powder-Toy/The-Powder-Toy@f9ccc…
Browse files Browse the repository at this point in the history
…24177e9)

Also add tpt-libs version to the subproject specification.
  • Loading branch information
LBPHacker committed Nov 7, 2024
1 parent ce0c7db commit 6e936db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ compile lua52
compile luajit

cat - << MESON > $temp_dir/$zip_root/meson.build
project('tpt-libs-prebuilt', [ 'c', 'cpp' ])
project('tpt-libs-prebuilt', 'cpp', version: '$BSH_VTAG')
host_arch = '$BSH_HOST_ARCH'
host_platform = '$BSH_HOST_PLATFORM'
Expand Down
57 changes: 28 additions & 29 deletions zip_stub/meson.template.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
is_static = static_dynamic == 'static'
is_debug = debug_release == 'debug'

c_compiler = meson.get_compiler('c')
cpp_compiler = meson.get_compiler('cpp')
config_dlls_pre = []

Expand All @@ -22,7 +21,7 @@ if host_platform != 'emscripten'
config_dlls_pre += [ [ join_paths(meson.current_source_dir(), 'luajit/bin'), luajit_name + '.dll', 'lua=luajit' ] ]
meson.override_dependency('luajit', declare_dependency(
dependencies: [
c_compiler.find_library(luajit_name, dirs: join_paths(meson.current_source_dir(), 'luajit', lib_dir), static: is_static),
cpp_compiler.find_library(luajit_name, dirs: join_paths(meson.current_source_dir(), 'luajit', lib_dir), static: is_static),
],
include_directories: [
include_directories('luajit/include'),
Expand All @@ -38,7 +37,7 @@ endif
config_dlls_pre += [ [ join_paths(meson.current_source_dir(), 'lua5.1/bin'), lua51_name + '.dll', 'lua=lua5.1' ] ]
meson.override_dependency('lua5.1-c++', declare_dependency(
dependencies: [
c_compiler.find_library(lua51_name, dirs: join_paths(meson.current_source_dir(), 'lua5.1', lib_dir), static: is_static),
cpp_compiler.find_library(lua51_name, dirs: join_paths(meson.current_source_dir(), 'lua5.1', lib_dir), static: is_static),
],
include_directories: [
include_directories('lua5.1/include'),
Expand All @@ -53,7 +52,7 @@ endif
config_dlls_pre += [ [ join_paths(meson.current_source_dir(), 'lua5.2/bin'), lua52_name + '.dll', 'lua=lua5.2' ] ]
meson.override_dependency('lua5.2-c++', declare_dependency(
dependencies: [
c_compiler.find_library(lua52_name, dirs: join_paths(meson.current_source_dir(), 'lua5.2', lib_dir), static: is_static),
cpp_compiler.find_library(lua52_name, dirs: join_paths(meson.current_source_dir(), 'lua5.2', lib_dir), static: is_static),
],
include_directories: [
include_directories('lua5.2/include'),
Expand All @@ -74,22 +73,22 @@ if host_platform != 'emscripten'
endif
meson.override_dependency('libcurl', declare_dependency(
dependencies: [
c_compiler.find_library(libcurl_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
c_compiler.find_library(nghttp2_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library(libcurl_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library(nghttp2_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
host_platform == 'windows' ? [
c_compiler.find_library('wsock32'),
c_compiler.find_library('ws2_32'),
c_compiler.find_library('crypt32'),
c_compiler.find_library('bcrypt'),
cpp_compiler.find_library('wsock32'),
cpp_compiler.find_library('ws2_32'),
cpp_compiler.find_library('crypt32'),
cpp_compiler.find_library('bcrypt'),
] : [],
host_platform == 'darwin' ? dependency('AppleFrameworks', modules: [
'Security',
'SystemConfiguration',
]) : [],
(is_static and (host_platform == 'linux' or host_platform == 'windows' or host_platform == 'android')) ? [
c_compiler.find_library('mbedcrypto', dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
c_compiler.find_library('mbedtls', dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
c_compiler.find_library('mbedx509', dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library('mbedcrypto', dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library('mbedtls', dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library('mbedx509', dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
] : [],
],
include_directories: [
Expand All @@ -102,7 +101,7 @@ endif
config_dlls_pre += [ [ join_paths(meson.current_source_dir(), 'bin'), dll_prefix + 'fftw3f.dll', 'all' ] ]
meson.override_dependency('fftw3f', declare_dependency(
dependencies: [
c_compiler.find_library('fftw3f', dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library('fftw3f', dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
],
include_directories: [
include_directories('include'),
Expand All @@ -125,7 +124,7 @@ if host_platform != 'emscripten'
config_dlls_pre += [ [ join_paths(meson.current_source_dir(), 'bin'), dll_prefix + zlib_name + '.dll', 'all' ] ]
meson.override_dependency('zlib', declare_dependency(
dependencies: [
c_compiler.find_library(zlib_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library(zlib_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
],
include_directories: [
include_directories('include'),
Expand All @@ -147,22 +146,22 @@ if host_platform != 'emscripten'
config_dlls_pre += [ [ join_paths(meson.current_source_dir(), 'bin'), sdl2_name + '.dll', 'all' ] ]
meson.override_dependency('sdl2', declare_dependency(
dependencies: [
c_compiler.find_library(sdl2_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
c_compiler.find_library(sdl2main_name, dirs: join_paths(meson.current_source_dir(), 'lib')),
cpp_compiler.find_library(sdl2_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library(sdl2main_name, dirs: join_paths(meson.current_source_dir(), 'lib')),
host_platform == 'windows' ? [
c_compiler.find_library('version'),
c_compiler.find_library('imm32'),
c_compiler.find_library('winmm'),
cpp_compiler.find_library('version'),
cpp_compiler.find_library('imm32'),
cpp_compiler.find_library('winmm'),
] : [],
host_platform == 'linux' ? [
c_compiler.find_library('dl'),
cpp_compiler.find_library('dl'),
] : [],
host_platform == 'android' ? [
c_compiler.find_library('dl'),
c_compiler.find_library('android'),
c_compiler.find_library('log'),
c_compiler.find_library('GLESv2'),
c_compiler.find_library('GLESv1_CM'),
cpp_compiler.find_library('dl'),
cpp_compiler.find_library('android'),
cpp_compiler.find_library('log'),
cpp_compiler.find_library('GLESv2'),
cpp_compiler.find_library('GLESv1_CM'),
] : [],
host_platform == 'darwin' ? dependency('AppleFrameworks', modules: [
'Cocoa',
Expand All @@ -172,7 +171,7 @@ if host_platform != 'emscripten'
'Carbon',
]) : [],
'@0@-@1@'.format(host_platform, host_libc) == 'windows-mingw' ? [
c_compiler.find_library('mingw32'),
cpp_compiler.find_library('mingw32'),
] : [],
],
include_directories: [
Expand All @@ -197,7 +196,7 @@ if host_platform != 'emscripten'
config_dlls_pre += [ [ join_paths(meson.current_source_dir(), 'bin'), 'lib' + png_name + '.dll', 'all' ] ]
meson.override_dependency('libpng16', declare_dependency(
dependencies: [
c_compiler.find_library(png_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library(png_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
],
include_directories: [
include_directories('include'),
Expand All @@ -223,7 +222,7 @@ if host_platform != 'emscripten'
config_dlls_pre += [ [ join_paths(meson.current_source_dir(), 'bin'), dll_prefix + bzip2_name + '.dll', 'all' ] ]
meson.override_dependency('bzip2', declare_dependency(
dependencies: [
c_compiler.find_library(bzip2_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
cpp_compiler.find_library(bzip2_name, dirs: join_paths(meson.current_source_dir(), lib_dir), static: is_static),
],
include_directories: [
include_directories('include'),
Expand Down

0 comments on commit 6e936db

Please sign in to comment.