From 07200855e197e1a86a86fe7da6a822bcf1828ef0 Mon Sep 17 00:00:00 2001 From: syzygial <67280346+syzygial@users.noreply.github.com> Date: Sat, 31 May 2025 22:38:52 -0400 Subject: [PATCH] Fix missing Lua::Lua target when using system Lua --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b54f71a3..fcac0cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,6 +276,10 @@ if (sol2-is-top-level-project) set(LUA_LIBRARIES ${lualib}) endif() + if(NOT TARGET Lua::Lua) + add_library(Lua::Lua ALIAS ${lualib}) + endif() + if (NOT LUA_FOUND AND NOT LUABUILD_FOUND) message(FATAL_ERROR "sol2 Lua \"${SOL2_LUA_VERSION}\" not found and could not be targeted for building") endif()