mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-28 06:21:25 +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)
|
||||
endif()
|
||||
|
||||
# Compile Lua as C++ to control errors with exceptions and have
|
||||
# stack unwinding (i.e. calling destructors correctly).
|
||||
if(MSVC)
|
||||
target_compile_options(lua PRIVATE -TP)
|
||||
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()
|
||||
# Compile Lua C files as C++ to control errors with exceptions and
|
||||
# have stack unwinding (i.e. calling destructors correctly).
|
||||
file(GLOB all_lua_source_files lua/*.c)
|
||||
set_source_files_properties(${all_lua_source_files} PROPERTIES LANGUAGE CXX)
|
||||
|
||||
target_compile_definitions(lua PUBLIC LUA_FLOORN2I=F2Ifloor)
|
||||
target_compile_definitions(lualib PRIVATE HAVE_SYSTEM)
|
||||
|
Loading…
Reference in New Issue
Block a user