Skip to content

Commit

Permalink
Backport #3436 (#3465)
Browse files Browse the repository at this point in the history
* Backport #3436

* Fix tests

---------

Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
  • Loading branch information
Hind-M and JohanMabille authored Oct 10, 2024
1 parent d69172d commit e10e643
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libmamba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ macro(libmamba_create_target target_name linkage output_name)

if (APPLE)
set (MAMBA_FORCE_DYNAMIC_LIBS resolv c++abi)
target_link_options(${target_name} PRIVATE -static-libstdc++)
target_link_options(${target_name} PRIVATE -nostdlib++)
elseif (UNIX)
set(MAMBA_FORCE_DYNAMIC_LIBS rt dl resolv)
target_link_options(${target_name} PUBLIC -static-libstdc++ -static-libgcc)
Expand Down
3 changes: 3 additions & 0 deletions micromamba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ message(STATUS "Micromamba linkage: ${MICROMAMBA_LINKAGE}")

if (${MICROMAMBA_LINKAGE} STREQUAL "STATIC")
target_link_libraries(micromamba PRIVATE libmamba-static)
if(APPLE)
target_link_options(micromamba PRIVATE -nostdlib++)
endif()
else ()
target_link_libraries(micromamba PRIVATE libmamba)
endif ()
Expand Down
4 changes: 2 additions & 2 deletions micromamba/tests/test_repoquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_depends_recursive(yaml_env: Path):
)

if platform.system() == "Linux":
assert "libzlib" in res
assert "_openmp_mutex" in res
elif platform.system() == "Darwin":
assert "libcxx" in res
elif platform.system() == "Windows":
Expand All @@ -91,7 +91,7 @@ def test_depends_tree(yaml_env: Path):
)

if platform.system() == "Linux":
assert "libzlib" in res
assert "_openmp_mutex" in res
elif platform.system() == "Darwin":
assert "libcxx" in res
elif platform.system() == "Windows":
Expand Down

0 comments on commit e10e643

Please sign in to comment.