-
-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,60 @@ | ||
project('sol2', 'cpp') | ||
|
||
# Find lua dependency | ||
if get_option('lua_cpp') | ||
lua_cpp = 'true' | ||
else | ||
lua_cpp = 'false' | ||
endif | ||
|
||
lua_dep = dependency('lua', fallback: [ 'lua', 'lua_dep' ], default_options: [ 'lua_cpp=' + lua_cpp ]) | ||
|
||
# Set compiler flags if we're compiling lua as C++. | ||
compile_args = [] | ||
|
||
if get_option('lua_cpp') | ||
compile_args = [ '-DSOL_USING_CXX_LUA=1' ] | ||
endif | ||
|
||
# Expose standard dependency. | ||
sol2_dep = declare_dependency( | ||
include_directories: include_directories('.'), | ||
compile_args: compile_args, | ||
dependencies: [ lua_dep ], | ||
) | ||
|
||
# Single header targets requested. | ||
if get_option('single') | ||
|
||
# Check if we have python installed (required for creating single). | ||
python = find_program('python3', required: false) | ||
|
||
if not python.found() | ||
python = find_program('python', required: false) | ||
endif | ||
|
||
if not python.found() | ||
error('Could not locate Python. Python is required when building a single header.') | ||
endif | ||
|
||
# List all headers that the single header comprises of. | ||
cmd = run_command(python, 'list-headers.py') | ||
|
||
if cmd.returncode() != 0 | ||
error('Could not list sol2 header files.') | ||
endif | ||
|
||
# Create our custom target to generate the single header file. | ||
sol2_single = custom_target('sol2_single', | ||
input: cmd.stdout().strip().split('\n'), | ||
output: 'sol.hpp', | ||
command: [ python, files('single.py'), '--output', '@OUTPUT@' ] | ||
) | ||
|
||
# Expose the dependency. | ||
sol2_dep = declare_dependency( | ||
sources: [ sol2_single ], | ||
compile_args: compile_args, | ||
dependencies: [ lua_dep ], | ||
) | ||
project('sol2', 'cpp') | ||
|
||
# Find lua dependency | ||
if get_option('lua_cpp') | ||
lua_cpp = 'true' | ||
else | ||
lua_cpp = 'false' | ||
endif | ||
|
||
lua_dep = dependency('lua', fallback: [ 'lua', 'lua_dep' ], default_options: [ 'lua_cpp=' + lua_cpp ]) | ||
|
||
# Set compiler flags if we're compiling lua as C++. | ||
compile_args = [] | ||
|
||
if get_option('lua_cpp') | ||
compile_args = [ '-DSOL_USING_CXX_LUA=1' ] | ||
endif | ||
|
||
# Expose standard dependency. | ||
sol2_dep = declare_dependency( | ||
include_directories: include_directories('.'), | ||
compile_args: compile_args, | ||
dependencies: [ lua_dep ], | ||
) | ||
|
||
# Single header targets requested. | ||
if get_option('single') | ||
|
||
# Check if we have python installed (required for creating single). | ||
python = find_program('python3', required: false) | ||
|
||
if not python.found() | ||
python = find_program('python', required: false) | ||
endif | ||
|
||
if not python.found() | ||
error('Could not locate Python. Python is required when building a single header.') | ||
endif | ||
|
||
# List all headers that the single header comprises of. | ||
cmd = run_command(python, 'list-headers.py') | ||
|
||
if cmd.returncode() != 0 | ||
error('Could not list sol2 header files.') | ||
endif | ||
|
||
# Create our custom target to generate the single header file. | ||
sol2_single = custom_target('sol2_single', | ||
input: cmd.stdout().strip().split('\n'), | ||
output: 'sol.hpp', | ||
command: [ python, files('single.py'), '--output', '@OUTPUT@' ] | ||
) | ||
|
||
# Expose the dependency. | ||
sol2_dep = declare_dependency( | ||
sources: [ sol2_single ], | ||
compile_args: compile_args, | ||
dependencies: [ lua_dep ], | ||
) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
option('single', type: 'boolean', value: false, description: 'Generate the sol2 single header and expose the corresponding build targets') | ||
option('single', type: 'boolean', value: false, description: 'Generate the sol2 single header and expose the corresponding build targets') | ||
option('lua_cpp', type: 'boolean', value: false, description: 'Compile lua as C++ code') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[wrap-file] | ||
directory = lua-5.3.4 | ||
source_url = https://www.lua.org/ftp/lua-5.3.4.tar.gz | ||
source_filename = lua-5.3.4.tar.gz | ||
source_hash = f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c | ||
patch_url = https://github.com/OrfeasZ/lua-meson/releases/download/v5.3.4/lua-5.3.4-wrap.zip | ||
patch_filename = lua-5.3.4-wrap.zip | ||
[wrap-file] | ||
directory = lua-5.3.4 | ||
|
||
source_url = https://www.lua.org/ftp/lua-5.3.4.tar.gz | ||
source_filename = lua-5.3.4.tar.gz | ||
source_hash = f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c | ||
|
||
patch_url = https://github.com/OrfeasZ/lua-meson/releases/download/v5.3.4/lua-5.3.4-wrap.zip | ||
patch_filename = lua-5.3.4-wrap.zip | ||
patch_hash = 400ca3e7f2a7e2a8363abe7a25f339b87488d56a1351ad843931a4d097624e57 |