Fixed Lua compilation on Windows.

This commit is contained in:
Patrick 2024-11-14 10:02:12 +01:00
parent 70fc36335a
commit 5490de84eb

View File

@ -37,8 +37,13 @@ def cook(env: Environment, version) -> dict:
checkout_root = repo['extracted_root']
src_folder = os.path.join(checkout_root, 'src')
lua_source_files = [f for f in env.RGlob(src_folder, '*.c') if f.name != 'lua.c']
additional_ccflags = []
if env['COMPILER_FAMILY'] in ('gcc', 'clang'):
additional_ccflags.append('-Wno-pedantic')
elif env['COMPILER_FAMILY'] == 'cl':
additional_ccflags.extend(['/wd4244', '/wd4310', '/wd4324', '/wd4701'])
lib_lua = env.StaticLibrary(
CCFLAGS = env['CCFLAGS'] + ['-Wno-pedantic'], # Lua uses a GNU extension for taking addresses of labels
CCFLAGS = env['CCFLAGS'] + additional_ccflags, # Lua uses a GNU extension for taking addresses of labels
target = env['LIB_DIR'] + '/lua_full',
source = lua_source_files
)