Skip to content

fix(LuaLib): Fix compilation with lua5.1 #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ endif()

if (LUA_VERSION MATCHES "luajit")
add_subdirectory(src/lualib/luajit)
set(LUAJIT_VERSION true)
else()
add_subdirectory(src/lualib/lua)
set(LUAJIT_VERSION false)
endif()

set_target_properties(lualib PROPERTIES INTERFACE_COMPILE_DEFINITIONS LUAJIT_VERSION)
4 changes: 4 additions & 0 deletions src/lualib/luajit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ if (WIN32)
PROPERTIES
IMPORTED_LOCATION ${LUA_BIN_FOLDER}/src/lua51.lib
INTERFACE_INCLUDE_DIRECTORIES "${LUA_SRC_FOLDER}/src"
INTERFACE_COMPILE_DEFINITIONS "LUAJIT_VERSION=1"
)

# install generated files
Expand Down Expand Up @@ -92,6 +93,7 @@ if (WIN32)
IMPORTED_LOCATION ${LUA_BIN_FOLDER}/src/lua51.dll
IMPORTED_IMPLIB ${LUA_BIN_FOLDER}/src/lua51.lib
INTERFACE_INCLUDE_DIRECTORIES "${LUA_SRC_FOLDER}/src"
INTERFACE_COMPILE_DEFINITIONS "LUAJIT_VERSION=1"
)

# install generated files
Expand Down Expand Up @@ -147,10 +149,12 @@ if (UNIX OR APPLE)
PROPERTIES
# IMPORTED_LOCATION ${LUAJIT_LIB_PATH} # cmake bullshit. spent days figuring this and turns out set_target_properties does squat shit while set_property works fine.
INTERFACE_INCLUDE_DIRECTORIES "${LUA_SRC_FOLDER}/src"
INTERFACE_COMPILE_DEFINITIONS "LUAJIT_VERSION=1"
)
set_property(TARGET lualib PROPERTY IMPORTED_LOCATION ${LUAJIT_LIB_PATH})

# install generated files
install(DIRECTORY ${LUA_INSTALL_PATH}/ DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()