Skip to content

Commit

Permalink
Fixed LuaInterpreter compilation with default options turned off (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkWanderer authored Jan 1, 2025
1 parent aa0ebe0 commit 468a2a0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
8 changes: 7 additions & 1 deletion Extern/Lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ install(TARGETS lua-exe DESTINATION ${ORBITER_INSTALL_SDK_DIR}/Utils/)

# Library - lua.dll
add_library(lua SHARED ${LUA_SRC_FILES})
target_compile_definitions(lua PUBLIC LUA_BUILD_AS_DLL)

if(MSVC)
target_compile_definitions(lua PUBLIC LUA_BUILD_AS_DLL)
else()
target_link_libraries(lua-exe PUBLIC m)
target_link_libraries(lua PUBLIC m)
endif()

set_target_properties(lua PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${ORBITER_BINARY_ROOT_DIR}
Expand Down
18 changes: 11 additions & 7 deletions Src/Module/LuaScript/LuaInterpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(BUILD_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/out)
add_library(LuaInterpreter SHARED
Interpreter.cpp
lua_vessel_mtd.cpp
lua_xrsound.cpp
lua_xrsound.cpp
)

target_include_directories(LuaInterpreter
Expand All @@ -21,18 +21,22 @@ target_link_libraries(LuaInterpreter
${ORBITER_LIB}
${ORBITER_SDK_LIB}
lua::lib
XRSound_lib
)

add_dependencies(LuaInterpreter
${OrbiterTgt}
Orbitersdk
D3D9Client
D3D9Client_Interface
XRSound_lib
XRSound_assets
)

if(ORBITER_BUILD_D3D9CLIENT)
add_dependencies(LuaInterpreter D3D9Client D3D9Client_Interface)
endif()

if(ORBITER_BUILD_XRSOUND)
add_dependencies(LuaInterpreter XRSound_lib XRSound_assets)
target_link_libraries(LuaInterpreter XRSound_lib)
endif()

set_target_properties(LuaInterpreter
PROPERTIES
FOLDER Modules/Lua
Expand Down Expand Up @@ -85,4 +89,4 @@ install(TARGETS LuaInterpreter
)
install(FILES $<TARGET_LINKER_FILE:LuaInterpreter>
DESTINATION ${ORBITER_INSTALL_SDK_DIR}/lib/Lua
)
)

0 comments on commit 468a2a0

Please sign in to comment.