From 9cecab2c6532ce2dcae26fe66d1e77f1a769666b Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Thu, 25 Jul 2024 09:31:52 +0900 Subject: [PATCH 1/5] add new env.var to set build configuration at runtime --- bindings/Sofa/package/__init__.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bindings/Sofa/package/__init__.py b/bindings/Sofa/package/__init__.py index 6bbe44a3..b8625d83 100644 --- a/bindings/Sofa/package/__init__.py +++ b/bindings/Sofa/package/__init__.py @@ -76,7 +76,19 @@ sofa_bin_path = os.path.join(sofa_root, "bin") sofapython3_bin_path = os.path.join(sofapython3_root, "bin") - compilation_modes = ["Release", "RelWithDebInfo", "Debug", "MinSizeRel"] + # A user using a build configuration could have a multiple-configuration type build + # which is typical on Windows and MSVC; and MacOS with XCode + # Previously the setup was arbitrarily choosing the first configuration it could find. + # Now, if the user set the env.var SOFA_BUILD_CONFIGURATION, he can choose a preferred configuration. + # If it is not found, it is considered as an error. + sofa_build_configuration = os.environ.get('SOFA_BUILD_CONFIGURATION') + compilation_modes = [] + if sofa_build_configuration: + print("SOFA_BUILD_CONFIGURATION is set to " + sofa_build_configuration) + compilation_modes = [sofa_build_configuration] + else: + compilation_modes = ["Release", "RelWithDebInfo", "Debug", "MinSizeRel"] # Standard multi-configuration modes in CMake + sofa_bin_compilation_modes = [] sofapython3_bin_compilation_modes = [] for mode in compilation_modes: @@ -94,7 +106,7 @@ sofapython3_bin_candidates = [sofapython3_bin_path] + sofapython3_bin_compilation_modes sofa_helper_dll = ["Sofa.Helper.dll", "Sofa.Helper_d.dll"] - + sofa_file_test = "" for candidate in sofa_bin_candidates: for dll in sofa_helper_dll: From 40d9bb0b0694f77d21e48b06afda0b79a28b794c Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Thu, 25 Jul 2024 09:32:11 +0900 Subject: [PATCH 2/5] remove comment about old behavior --- bindings/Sofa/package/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bindings/Sofa/package/__init__.py b/bindings/Sofa/package/__init__.py index b8625d83..d8bbc6dd 100644 --- a/bindings/Sofa/package/__init__.py +++ b/bindings/Sofa/package/__init__.py @@ -78,8 +78,7 @@ # A user using a build configuration could have a multiple-configuration type build # which is typical on Windows and MSVC; and MacOS with XCode - # Previously the setup was arbitrarily choosing the first configuration it could find. - # Now, if the user set the env.var SOFA_BUILD_CONFIGURATION, he can choose a preferred configuration. + # If the user set the env.var SOFA_BUILD_CONFIGURATION, he can choose a preferred configuration. # If it is not found, it is considered as an error. sofa_build_configuration = os.environ.get('SOFA_BUILD_CONFIGURATION') compilation_modes = [] From dbf694e8927125e90ebabe43f46aa8e5b48736cf Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Tue, 16 Jul 2024 13:55:45 +0900 Subject: [PATCH 3/5] test --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75b96a00..52705627 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Setup SOFA and environment id: sofa - uses: sofa-framework/sofa-setup-action@v5 + uses: fredroy/sofa-setup-action@v5-custom with: sofa_root: ${{ github.workspace }}/sofa sofa_version: ${{ matrix.sofa_branch }} From 837f0354b87413a48d027811059279716ab0d897 Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Wed, 31 Jul 2024 18:01:36 +0900 Subject: [PATCH 4/5] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52705627..75b96a00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Setup SOFA and environment id: sofa - uses: fredroy/sofa-setup-action@v5-custom + uses: sofa-framework/sofa-setup-action@v5 with: sofa_root: ${{ github.workspace }}/sofa sofa_version: ${{ matrix.sofa_branch }} From e78870a2d401ec886e8b223bb254c987bc48bb48 Mon Sep 17 00:00:00 2001 From: Alex Bilger Date: Wed, 31 Jul 2024 14:25:36 +0200 Subject: [PATCH 5/5] Update bindings/Sofa/package/__init__.py --- bindings/Sofa/package/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/bindings/Sofa/package/__init__.py b/bindings/Sofa/package/__init__.py index d8bbc6dd..747d6023 100644 --- a/bindings/Sofa/package/__init__.py +++ b/bindings/Sofa/package/__init__.py @@ -105,7 +105,6 @@ sofapython3_bin_candidates = [sofapython3_bin_path] + sofapython3_bin_compilation_modes sofa_helper_dll = ["Sofa.Helper.dll", "Sofa.Helper_d.dll"] - sofa_file_test = "" for candidate in sofa_bin_candidates: for dll in sofa_helper_dll: