mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-30 12:19:04 +00:00
Lua was still being compiled as C (instead of C++) when generating Visual Studio solutions
We're compiling Lua as C++, but it seems that target_compile_options() doesn't work for Visual Studio solutions (only for Ninja/makefiles). The proper cmake solution to this issue is using set_source_files_properties() to specify C++ as the language to use to compile all Lua C files. This generates a valid Visual Studio solution.
This commit is contained in:
parent
11883a51ff
commit
a49bfe7f0a
15
third_party/CMakeLists.txt
vendored
15
third_party/CMakeLists.txt
vendored
@ -204,17 +204,10 @@ if(ENABLE_SCRIPTING)
|
|||||||
target_compile_definitions(lua PUBLIC LUA_USE_LINUX=1)
|
target_compile_definitions(lua PUBLIC LUA_USE_LINUX=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compile Lua as C++ to control errors with exceptions and have
|
# Compile Lua C files as C++ to control errors with exceptions and
|
||||||
# stack unwinding (i.e. calling destructors correctly).
|
# have stack unwinding (i.e. calling destructors correctly).
|
||||||
if(MSVC)
|
file(GLOB all_lua_source_files lua/*.c)
|
||||||
target_compile_options(lua PRIVATE -TP)
|
set_source_files_properties(${all_lua_source_files} PROPERTIES LANGUAGE CXX)
|
||||||
target_compile_options(lualib PRIVATE -TP)
|
|
||||||
target_compile_options(lauxlib PRIVATE -TP)
|
|
||||||
else()
|
|
||||||
target_compile_options(lua PRIVATE -xc++)
|
|
||||||
target_compile_options(lualib PRIVATE -xc++)
|
|
||||||
target_compile_options(lauxlib PRIVATE -xc++)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_compile_definitions(lua PUBLIC LUA_FLOORN2I=F2Ifloor)
|
target_compile_definitions(lua PUBLIC LUA_FLOORN2I=F2Ifloor)
|
||||||
target_compile_definitions(lualib PRIVATE HAVE_SYSTEM)
|
target_compile_definitions(lualib PRIVATE HAVE_SYSTEM)
|
||||||
|
Loading…
Reference in New Issue
Block a user