From edfa32a88bc3b8e676b2a6e093e942b64df0dd72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Kubler?= <gregoire.kubler@proton.me>
Date: Thu, 2 May 2024 18:41:02 +0200
Subject: [PATCH] fix: missing link

---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 669b72380..37b8fc677 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,7 +24,6 @@ option(ENABLE_ASAN "Enable ASan (AddressSanitizer) for runtime analysis of memor
 ##############################################
 # Import utils CMakeLists
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
-include(PybindModuleCreation)
 
 if(CMAKE_COMPILER_IS_GNUCXX AND COVERAGE)
     Include(CodeCoverage)
@@ -79,6 +78,7 @@ endif()
 
 # PYTHON BINDING
 if (PYBIND)
+    include(PybindModuleCreation)
     find_package(Python REQUIRED)
     if (${Python_VERSION_MAJOR} LESS 3)
         MESSAGE(FATAL_ERROR "Unsupported Python version. Python 3.0.0+ is required")
@@ -87,6 +87,8 @@ if (PYBIND)
 
     # Handles Python + pybind11 headers dependencies
     target_link_libraries(${module_name}
+        PRIVATE
+            Python::Python
         PUBLIC
             pybind11::pybind11
         )
-- 
GitLab