Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions bindings/Sofa/package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,18 @@
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
# 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:
Expand All @@ -94,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:
Expand Down