1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Description: Add missing Lua::Lua cmake target
When Lua is not built from source, a Lua::Lua
target is not created by cmake
Forwarded: https://github.com/ThePhD/sol2/pull/1704
Author: syzygial <syzygial.123@gmail.com>
Last-Update: 2025-05-30
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e14f57..9fda891 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -283,6 +283,10 @@ if (sol2-is-top-level-project)
set(LUA_LIBRARIES ${lualib})
endif()
+ if((NOT TARGET Lua::Lua) AND NOT SOL2_SKIP_VERSION_CHECK)
+ add_library(Lua::Lua ALIAS ${lualib})
+ endif()
+
if (NOT LUA_FOUND AND NOT LUABUILD_FOUND AND NOT SOL2_SKIP_VERSION_CHECK)
message(FATAL_ERROR "sol2 Lua \"${SOL2_LUA_VERSION}\" not found and could not be targeted for building")
endif()
|