-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb/CMake] Only auto-enable Lua when SWIG is found
Just like Python, Lua should only be auto-enabled if SWIG is found as well. This moves the logic of finding SWIG and Lua as a whole into a new CMake package.
- Loading branch information
1 parent
2d258ed
commit edadb81
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#.rst: | ||
# FindLuaAndSwig | ||
# -------------- | ||
# | ||
# Find Lua and SWIG as a whole. | ||
|
||
if(LUA_LIBRARIES AND LUA_INCLUDE_DIR AND SWIG_EXECUTABLE) | ||
set(LUAANDSWIG_FOUND TRUE) | ||
else() | ||
find_package(SWIG 2.0 QUIET) | ||
if (SWIG_FOUND) | ||
find_package(Lua QUIET) | ||
if(LUA_FOUND AND SWIG_FOUND) | ||
mark_as_advanced( | ||
LUA_LIBRARIES | ||
LUA_INCLUDE_DIR | ||
SWIG_EXECUTABLE) | ||
endif() | ||
else() | ||
message(STATUS "SWIG 2 or later is required for Lua support in LLDB but could not be found") | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LuaAndSwig | ||
FOUND_VAR | ||
LUAANDSWIG_FOUND | ||
REQUIRED_VARS | ||
LUA_LIBRARIES | ||
LUA_INCLUDE_DIR | ||
SWIG_EXECUTABLE) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters