From b81c6b5186b0aa51d85498c28a40af0877dd1afb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20KUBLER?= <gregoire.kubler@proton.me>
Date: Fri, 5 Jul 2024 11:51:40 +0200
Subject: [PATCH] fix: re set ninja as default build backend for python except
 if AIDGE_BUILD_GEN is set in environment

---
 setup.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/setup.py b/setup.py
index 622d2f746..cb6ee1a4a 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,6 @@ import os
 import shutil
 import pathlib
 import multiprocessing
-import platform
 
 from math import ceil
 
@@ -52,12 +51,16 @@ class CMakeBuild(build_ext):
             if "AIDGE_INSTALL" not in os.environ
             else os.environ["AIDGE_INSTALL"]
         )
-        # Ninja doesn't work for windows build on the ci for now
-        build_gen = ["-G", "Ninja"] if "Windows" in platform.system() else []
+        build_gen = (
+            ["-G",[os.environ["AIDGE_BUILD_GEN"]]
+            if "AIDGE_BUILD_GEN" in os.environ
+            else [-G,"Ninja"]  # using ninja as default build system to build faster and with the same compiler as on windows
+        )
+        
         self.spawn(
             [
                 "cmake",
-                *build_gen,  # using ninja as build system to build faster and with the same compiler as on windows
+                *build_gen,
                 str(cwd),
                 "-DTEST=OFF",
                 f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}",
-- 
GitLab