Skip to content

Commit

Permalink
Complete Meson to install correctly all the required files
Browse files Browse the repository at this point in the history
  • Loading branch information
franko committed Jun 26, 2019
1 parent 143cf70 commit b99fff0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
16 changes: 11 additions & 5 deletions lang/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ lang_sources = ['ast-boolean-const-eval.lua', 'ast-const-eval.lua', 'bcread.lua'

luajit = find_program('luajit')

bc_generator = generator(luajit,
arguments: ['-b', '@INPUT@', '@OUTPUT@'],
output : '@[email protected]',
)
lang_bc_headers = []
foreach lua_source : lang_sources
lang_bc_headers += custom_target(lua_source + '.h',
input: lua_source,
output: '@[email protected]',
command: [luajit, '-b', '@INPUT@', '@OUTPUT@']
)
endforeach

lang_bc_headers = bc_generator.process(lang_sources)
lua_module_install_dir = 'share/lua/5.1'

install_data(lang_sources, install_dir: lua_module_install_dir + '/lang')
20 changes: 11 additions & 9 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
lang_cargs = []
lang_cflags = []

if host_machine.system() == 'darwin'
lang_cargs += ['-pagezero_size', '10000', '-image_base', '100000000']
lang_cflags += ['-pagezero_size', '10000', '-image_base', '100000000']
endif

lang_sources = ['language.c', 'language_loaders.c']

if get_option('preload')
lang_sources += 'language_bcloader.c'
lang_cargs += '-DBC_PRELOAD'
lang_sources += 'language_bcloader.c'
lang_cflags += '-DBC_PRELOAD'
endif

luajit_dep = dependency('luajit')

liblang = static_library('liblang',
lang_sources,
lang_sources + lang_bc_headers,
include_directories: lang_headers_dir,
c_args: lang_cargs,
c_args: lang_cflags,
dependencies: luajit_dep,
install: true,
)

luajit_x = executable('luajit-x',
'luajit-x.c',
['luajit-x.c'] + lang_bc_headers,
include_directories: lang_headers_dir,
dependencies: luajit_dep,
c_args: lang_cargs,
link_with: liblang
c_args: lang_cflags,
link_with: liblang,
install: true,
)

0 comments on commit b99fff0

Please sign in to comment.