From 64f1e7a07944a5353e316083858bf4862a1e7687 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Kubler?= <gregoire.kubler@proton.me>
Date: Tue, 7 May 2024 13:53:22 +0200
Subject: [PATCH] chore : python exec debug

---
 CMakeLists.txt | 4 +++-
 setup.py       | 6 +++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5bd4f1458..2a527dc6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -87,9 +87,11 @@ if (PYBIND)
 
     # Handles Python + pybind11 headers dependencies
     target_link_libraries(${module_name}
+        PRIVATE
+            Python::Python
         PUBLIC
             pybind11::pybind11
-        )
+    )
 endif()
 
 target_link_libraries(${module_name} PUBLIC Threads::Threads fmt::fmt)
diff --git a/setup.py b/setup.py
index 370f72a6e..e92cd901a 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,6 @@ import os
 
 import shutil
 import pathlib
-import subprocess
 import multiprocessing
 
 from math import ceil
@@ -46,7 +45,8 @@ class CMakeBuild(build_ext):
 
         # Impose to use the executable of the python
         # used to launch setup.py to setup PythonInterp
-        param_py = "-DPYTHON_EXECUTABLE=" + sys.executable
+        python_executable = sys.executable
+        print(f"python executable {python_executable}")
 
         compile_type = "Debug"
         install_path = (
@@ -59,7 +59,7 @@ class CMakeBuild(build_ext):
             [
                 "cmake",
                 str(cwd),
-                param_py,
+                "-DPYTHON_EXECUTABLE="+python_executable,
                 "-DTEST=OFF",
                 f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}",
                 f"-DCMAKE_BUILD_TYPE={compile_type}",
-- 
GitLab