From 4ff26bf58b87b466edcb699ea046bd42fbfccd6c Mon Sep 17 00:00:00 2001
From: gregkub <gregoire.kubler@proton.me>
Date: Fri, 26 Apr 2024 11:27:15 +0200
Subject: [PATCH] feat : now cibuildwheel works on windows

---
 ...uildwheel_build_deps_before_build_wheel.sh | 31 +++++++++++--------
 pyproject.toml                                |  2 +-
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh b/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh
index 699cb50d2..d515d9a40 100755
--- a/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh
+++ b/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh
@@ -1,20 +1,25 @@
 #!/bin/bash
 set -x
 set -e
-for repo in $AIGE_DEPENDENCIES ; do
-  REPO_PATH=$(find /host/home/ -type d -name $repo \
-                               -not -path '*install*' \
-                               -not -path '*.git*' \
-                               -not -path '*miniconda*' \
-                               -not -path '*.local*' \
-                               -not -path "*lib*" \
-                               -not -path "*/$repo/$repo" \
-                               -print -quit) 
-
-  cd $REPO_PATH
+if [[ $repo ==  "" ]]; then # case for aidge_ core
   mkdir -p build # creating build if its not already there to hold the build of cpp files
   rm -rf build/* # build from scratch
-  pip install . -v
-done
+else 
+  for repo in $AIGE_DEPENDENCIES ; do # case for other projects
+    REPO_PATH=$(find /host/home/ -type d -name $repo \
+                                -not -path '*install*' \
+                                -not -path '*.git*' \
+                                -not -path '*miniconda*' \
+                                -not -path '*.local*' \
+                                -not -path "*lib*" \
+                                -not -path "*/$repo/$repo" \
+                                -print -quit) 
+
+    cd $REPO_PATH
+    mkdir -p build # creating build if its not already there to hold the build of cpp files
+    rm -rf build/* # build from scratch
+    pip install . -v
+  done
+fi
 set +x
 set +e
diff --git a/pyproject.toml b/pyproject.toml
index 17a8d888e..611692e74 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -5,7 +5,7 @@
 
 [tool.cibuildwheel]
 build-frontend = "build"
-before-build = [".gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh ${AIDGE_DEPENDENCIES}"]
+before-build = ["bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh ${AIDGE_DEPENDENCIES}"]
 
 [tool.cibuildwheel.environment]
 
-- 
GitLab