From e6541e0bb889b24f507e6eb58b778b415e589af9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Kubler?= <gregoire.kubler@proton.me>
Date: Tue, 21 May 2024 12:31:58 +0200
Subject: [PATCH] feat : AIDGE_PYTHON_BUILD_TYPE

---
 setup.py | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/setup.py b/setup.py
index 2df428c..1a41bf5 100644
--- a/setup.py
+++ b/setup.py
@@ -42,22 +42,18 @@ class CMakeBuild(build_ext):
 
         os.chdir(str(build_temp))
 
-        python_executable = sys.executable 
-        python_include_dirs = sysconfig.get_path('include') 
-        python_library = sysconfig.get_config_var('LIBDIR') 
-        python_prefix = sys.exec_prefix 
-        print(f"python\texecutable\t{python_executable}") 
-        print(f"\t\t\tinclude\tdirs {python_include_dirs}") 
-        print(f"-DPYTHON_INCLUDE_DIRS={sysconfig.get_config_var('INCLUDEPY')}") 
-        print(f"\t\t\tlibrary\t{python_library}") 
-        print(f"-DPYTHON_LIBRARIES={sysconfig.get_config_var('LIBDEST')}") 
-        print(f"\t\t\tprefix\t{python_prefix}") 
+        # Impose to use the executable of the python
+        # used to launch setup.py to setup PythonInterp
+        python_executable = sys.executable
+        print(f"python executable :\t{python_executable}")
+        compile_type = (
+            "Release"
+            if "AIDGE_PYTHON_BUILD_TYPE" not in os.environ
+            else os.environ["AIDGE_PYTHON_BUILD_TYPE"]
+        )
 
         # Impose to use the executable of the python                                                                                                                                                  
         # used to launch setup.py to setup PythonInterp                                                                                                                                                   
-        python_executable = sys.executable                                                                                                                                                                
-        print(f"python executable :\t{python_executable}")                                                                                                                                                   
-        compile_type = "Debug"
         install_path = (
             os.path.join(sys.prefix, "lib", "libAidge")
             if "AIDGE_INSTALL" not in os.environ
-- 
GitLab