diff --git a/setup.py b/setup.py
index 71a29afbf15790a59293e49d294de8357c50b8b2..622d2f7460087f851238f82d57b97037073d8d3b 100644
--- a/setup.py
+++ b/setup.py
@@ -3,6 +3,7 @@ import os
 import shutil
 import pathlib
 import multiprocessing
+import platform
 
 from math import ceil
 
@@ -51,11 +52,12 @@ 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 []
         self.spawn(
             [
                 "cmake",
-                "-GNinja", # using ninja as build system to build faster and with the same compiler as on windows
+                *build_gen,  # using ninja as build system to build faster and with the same compiler as on windows
                 str(cwd),
                 "-DTEST=OFF",
                 f"-DCMAKE_INSTALL_PREFIX:PATH={install_path}",