Publish precompiled tp6.c blob (lots of dirty hacks)
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
fs = import('fs')
|
||||
|
||||
include_dir = include_directories('include')
|
||||
|
||||
# Input files
|
||||
sources = [
|
||||
'src/main.c',
|
||||
@ -8,10 +12,7 @@ sources = [
|
||||
'src/hi3.c',
|
||||
'src/hsr.c',
|
||||
'src/utils.c',
|
||||
'src/msg.c',
|
||||
|
||||
# File withheld to make abuse more difficult
|
||||
'src/tp6.c'
|
||||
'src/msg.c'
|
||||
]
|
||||
resources = [
|
||||
'res/hi3/glb/allocations.dat',
|
||||
@ -24,17 +25,53 @@ resources = [
|
||||
]
|
||||
|
||||
# Generate resource files for ./res
|
||||
res_files = custom_target(
|
||||
'resources.[ho]',
|
||||
output: [ 'resources.o', 'resources.h' ],
|
||||
res_header = custom_target(
|
||||
'resources.h',
|
||||
output: 'resources.h',
|
||||
input: resources,
|
||||
command: [ gen_res, meson.current_source_dir(), '@OUTPUT0@', '@OUTPUT1@', '@INPUT@' ]
|
||||
command: [ gen_res, '--header', meson.current_source_dir(), '@OUTPUT0@', '@INPUT@' ]
|
||||
)
|
||||
res_object = custom_target(
|
||||
'resources.o',
|
||||
output: 'resources.o',
|
||||
input: resources,
|
||||
command: [ gen_res, '--object', meson.current_source_dir(), '@OUTPUT0@', '@INPUT@' ]
|
||||
)
|
||||
|
||||
if fs.exists('src/tp6.c')
|
||||
# Compile the real file first (dirty hack)
|
||||
tp6c_fake_exe = executable(
|
||||
'tp6c.obj',
|
||||
'src/tp6.c',
|
||||
res_header,
|
||||
link_args: [ '-r' ], # Output an object file
|
||||
include_directories: include_dir
|
||||
)
|
||||
|
||||
# another dirty hack
|
||||
copy_tp6c = find_program('copy_tp6c.sh')
|
||||
|
||||
tp6c = custom_target(
|
||||
'copy_tp6c',
|
||||
output: 'tp6c.obj',
|
||||
input: tp6c_fake_exe.extract_all_objects(recursive: false),
|
||||
command: [
|
||||
copy_tp6c,
|
||||
'@INPUT0@',
|
||||
'@OUTPUT0@', meson.current_source_dir() / 'blob/tp6c.obj'
|
||||
]
|
||||
)
|
||||
else
|
||||
message('Using precompiled tp6c blob. Refer to the readme for more details')
|
||||
tp6c = 'blob/tp6c.obj'
|
||||
endif
|
||||
|
||||
shared_library(
|
||||
'game_payload',
|
||||
sources,
|
||||
res_files,
|
||||
include_directories: 'include',
|
||||
tp6c,
|
||||
res_header,
|
||||
res_object,
|
||||
include_directories: include_dir,
|
||||
name_prefix: ''
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user