Skip to content

Commit

Permalink
More accurate build and install with the bc preload option
Browse files Browse the repository at this point in the history
Only when using preload, generate the header files and omit installation
of the Lua lang implementation files.
  • Loading branch information
franko committed Jun 26, 2019
1 parent 6f36257 commit 6e1ec93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
21 changes: 13 additions & 8 deletions lang/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ lang_sources = ['ast-boolean-const-eval.lua', 'ast-const-eval.lua', 'bcread.lua'
luajit = find_program('luajit')

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

if bytecode_preload
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
endif

lua_module_install_dir = 'share/lua/5.1'

install_data(lang_sources, install_dir: lua_module_install_dir + '/lang')
if not bytecode_preload
install_data(lang_sources, install_dir: lua_module_install_dir + '/lang')
endif
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ project('luajit-lang-toolkit', 'c', version : '1.0', default_options : 'c_std=c9

pkg = import('pkgconfig')

bytecode_preload = get_option('preload')

lang_headers_dir = include_directories('.')

subdir('lang')
Expand Down
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif

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

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

0 comments on commit 6e1ec93

Please sign in to comment.