Skip to content

Commit

Permalink
Merge pull request #489 from squeek502/lua-libs-required
Browse files Browse the repository at this point in the history
CMake: Only require finding Lua libs via find_package on Windows
  • Loading branch information
squeek502 authored May 11, 2020
2 parents 6ccddc4 + 668fe45 commit ffe83b1
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 ffe83b1

Please sign in to comment.