Skip to content

Commit

Permalink
CMake: Only require finding Lua libs via find_package on Windows
Browse files Browse the repository at this point in the history
Introduced in #346, fixes #488
  • Loading branch information
squeek502 committed May 3, 2020
1 parent 9054ac8 commit 668fe45
Showing 1 changed file with 21 additions and 3 deletions.
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

0 comments on commit 668fe45

Please sign in to comment.