Skip to content
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

CMake: Only require finding Lua libs via find_package on Windows #489

Merged
merged 1 commit into from
May 11, 2020
Merged
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
24 changes: 21 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,29 @@ if (LUA)
else (LUA)
if (LUA_BUILD_TYPE STREQUAL System)
if (USE_LUAJIT)
find_package(LuaJIT REQUIRED)
# We only link the libs on Windows, so find_package fully succeeding
# is only required on Windows
if (WIN32)
find_package(LuaJIT REQUIRED)
link_directories(${LUAJIT_LIBRARIES})
else()
find_package(LuaJIT)
endif()
if(NOT LUAJIT_INCLUDE_DIR)
message( FATAL_ERROR "Failed to find LuaJIT headers. Variable `LUAJIT_INCLUDE_DIR' expected to be defined.")
endif()
include_directories(${LUAJIT_INCLUDE_DIR})
link_directories(${LUAJIT_LIBRARIES})
else (USE_LUAJIT)
find_package(Lua REQUIRED)
# We only link the libs on Windows, so find_package fully succeeding
# is only required on Windows
if (WIN32)
find_package(Lua REQUIRED)
else()
find_package(Lua)
endif()
if(NOT LUA_INCLUDE_DIR)
message( FATAL_ERROR "Failed to find Lua headers. Variable `LUA_INCLUDE_DIR' expected to be defined.")
endif()
include_directories(${LUA_INCLUDE_DIR})
endif (USE_LUAJIT)

Expand Down