Skip to content

Commit

Permalink
Configure a preliminary version of Meson build
Browse files Browse the repository at this point in the history
Works to compile but should be completed to install correctly.
  • Loading branch information
franko committed Jun 25, 2019
1 parent 2b08eda commit 143cf70
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lang/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
lang_sources = ['ast-boolean-const-eval.lua', 'ast-const-eval.lua', 'bcread.lua', 'bcsave.lua', 'bytecode.lua', 'compile.lua', 'generator.lua', 'lexer.lua', 'id-generator.lua', 'lua-ast.lua', 'operator.lua', 'parser.lua', 'reader.lua']

luajit = find_program('luajit')

bc_generator = generator(luajit,
arguments: ['-b', '@INPUT@', '@OUTPUT@'],
output : '@[email protected]',
)

lang_bc_headers = bc_generator.process(lang_sources)
6 changes: 6 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project('luajit-lang-toolkit', 'c', version : '1.0', default_options : 'c_std=c99')

lang_headers_dir = include_directories('.')

subdir('lang')
subdir('src')
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
option('preload', type : 'boolean', value : false, description: 'bytecode preload')
29 changes: 29 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
lang_cargs = []

if host_machine.system() == 'darwin'
lang_cargs += ['-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'
endif

luajit_dep = dependency('luajit')

liblang = static_library('liblang',
lang_sources,
include_directories: lang_headers_dir,
c_args: lang_cargs,
dependencies: luajit_dep,
)

luajit_x = executable('luajit-x',
'luajit-x.c',
include_directories: lang_headers_dir,
dependencies: luajit_dep,
c_args: lang_cargs,
link_with: liblang
)

0 comments on commit 143cf70

Please sign in to comment.