Skip to content

Commit

Permalink
Fix line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
OrfeasZ committed Jun 6, 2018
1 parent 8143778 commit 4e7c194
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 69 deletions.
118 changes: 59 additions & 59 deletions meson.build
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
2 changes: 1 addition & 1 deletion meson_options.txt
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')
18 changes: 9 additions & 9 deletions subprojects/lua.wrap
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

0 comments on commit 4e7c194

Please sign in to comment.