From e10e6436e71248b1eba5b6a12ff3f30f2ab5ba51 Mon Sep 17 00:00:00 2001 From: Hind-M <70631848+Hind-M@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:49:37 +0200 Subject: [PATCH] Backport #3436 (#3465) * Backport #3436 * Fix tests --------- Co-authored-by: Johan Mabille --- libmamba/CMakeLists.txt | 2 +- micromamba/CMakeLists.txt | 3 +++ micromamba/tests/test_repoquery.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index c64f55ffc4..41f6c85e49 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -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) diff --git a/micromamba/CMakeLists.txt b/micromamba/CMakeLists.txt index e223ed1232..7a55d8f4cb 100644 --- a/micromamba/CMakeLists.txt +++ b/micromamba/CMakeLists.txt @@ -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 () diff --git a/micromamba/tests/test_repoquery.py b/micromamba/tests/test_repoquery.py index 775a3dfa72..53a4191525 100644 --- a/micromamba/tests/test_repoquery.py +++ b/micromamba/tests/test_repoquery.py @@ -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": @@ -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":