Fix line endings

This commit is contained in:
Orfeas Zafeiris 2018-06-06 10:02:37 +03:00
parent 814377890f
commit 4e7c194789
3 changed files with 69 additions and 69 deletions

View File

@ -1,60 +1,60 @@
project('sol2', 'cpp') project('sol2', 'cpp')
# Find lua dependency # Find lua dependency
if get_option('lua_cpp') if get_option('lua_cpp')
lua_cpp = 'true' lua_cpp = 'true'
else else
lua_cpp = 'false' lua_cpp = 'false'
endif endif
lua_dep = dependency('lua', fallback: [ 'lua', 'lua_dep' ], default_options: [ 'lua_cpp=' + lua_cpp ]) lua_dep = dependency('lua', fallback: [ 'lua', 'lua_dep' ], default_options: [ 'lua_cpp=' + lua_cpp ])
# Set compiler flags if we're compiling lua as C++. # Set compiler flags if we're compiling lua as C++.
compile_args = [] compile_args = []
if get_option('lua_cpp') if get_option('lua_cpp')
compile_args = [ '-DSOL_USING_CXX_LUA=1' ] compile_args = [ '-DSOL_USING_CXX_LUA=1' ]
endif endif
# Expose standard dependency. # Expose standard dependency.
sol2_dep = declare_dependency( sol2_dep = declare_dependency(
include_directories: include_directories('.'), include_directories: include_directories('.'),
compile_args: compile_args, compile_args: compile_args,
dependencies: [ lua_dep ], dependencies: [ lua_dep ],
) )
# Single header targets requested. # Single header targets requested.
if get_option('single') if get_option('single')
# Check if we have python installed (required for creating single). # Check if we have python installed (required for creating single).
python = find_program('python3', required: false) python = find_program('python3', required: false)
if not python.found() if not python.found()
python = find_program('python', required: false) python = find_program('python', required: false)
endif endif
if not python.found() if not python.found()
error('Could not locate Python. Python is required when building a single header.') error('Could not locate Python. Python is required when building a single header.')
endif endif
# List all headers that the single header comprises of. # List all headers that the single header comprises of.
cmd = run_command(python, 'list-headers.py') cmd = run_command(python, 'list-headers.py')
if cmd.returncode() != 0 if cmd.returncode() != 0
error('Could not list sol2 header files.') error('Could not list sol2 header files.')
endif endif
# Create our custom target to generate the single header file. # Create our custom target to generate the single header file.
sol2_single = custom_target('sol2_single', sol2_single = custom_target('sol2_single',
input: cmd.stdout().strip().split('\n'), input: cmd.stdout().strip().split('\n'),
output: 'sol.hpp', output: 'sol.hpp',
command: [ python, files('single.py'), '--output', '@OUTPUT@' ] command: [ python, files('single.py'), '--output', '@OUTPUT@' ]
) )
# Expose the dependency. # Expose the dependency.
sol2_dep = declare_dependency( sol2_dep = declare_dependency(
sources: [ sol2_single ], sources: [ sol2_single ],
compile_args: compile_args, compile_args: compile_args,
dependencies: [ lua_dep ], dependencies: [ lua_dep ],
) )
endif endif

View File

@ -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') option('lua_cpp', type: 'boolean', value: false, description: 'Compile lua as C++ code')

View File

@ -1,10 +1,10 @@
[wrap-file] [wrap-file]
directory = lua-5.3.4 directory = lua-5.3.4
source_url = https://www.lua.org/ftp/lua-5.3.4.tar.gz source_url = https://www.lua.org/ftp/lua-5.3.4.tar.gz
source_filename = lua-5.3.4.tar.gz source_filename = lua-5.3.4.tar.gz
source_hash = f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c source_hash = f681aa518233bc407e23acf0f5887c884f17436f000d453b2491a9f11a52400c
patch_url = https://github.com/OrfeasZ/lua-meson/releases/download/v5.3.4/lua-5.3.4-wrap.zip 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_filename = lua-5.3.4-wrap.zip
patch_hash = 400ca3e7f2a7e2a8363abe7a25f339b87488d56a1351ad843931a4d097624e57 patch_hash = 400ca3e7f2a7e2a8363abe7a25f339b87488d56a1351ad843931a4d097624e57