Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't force MSVC_RUNTIME #2861

Merged
merged 4 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/static_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ jobs:
- name: Checkout micromamba-feedstock
uses: actions/checkout@v3
with:
repository: conda-forge/micromamba-feedstock
# Running a fork until we can merge the changes in micromamba-feedstock
# https://github.com/conda-forge/micromamba-feedstock/pull/154
repository: AntoinePrv/micromamba-feedstock
ref: tmp-mamba-ci
path: micromamba-feedstock
- name: Clear micromamba-feedstock git directory
run: rm -rf "micromamba-feedstock/.git"
Expand Down Expand Up @@ -131,6 +134,7 @@ jobs:
-B build ^
-D CMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-D CMAKE_C_COMPILER_LAUNCHER=sccache ^
-D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ^
-D CMAKE_BUILD_TYPE="Release" ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_STATIC=ON ^
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
-G Ninja ^
-D CMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-D CMAKE_BUILD_TYPE="Release" ^
-D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" ^
-D BUILD_LIBMAMBA_TESTS=ON ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_SHARED=ON ^
Expand Down Expand Up @@ -99,6 +100,7 @@ jobs:
-G Ninja ^
-D CMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-D CMAKE_BUILD_TYPE="Release" ^
-D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" ^
-D BUILD_LIBMAMBAPY=ON ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_SHARED=ON ^
Expand Down Expand Up @@ -180,6 +182,8 @@ jobs:
cmake -B build/ ^
-G Ninja ^
-D CMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-D CMAKE_BUILD_TYPE="Release" ^
-D CMAKE_MSVC_RUNTIME_LIBRARY="MultiThreadedDLL" ^
-D BUILD_MICROMAMBA=ON ^
-D BUILD_LIBMAMBA=ON ^
-D BUILD_SHARED=ON ^
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ if (MSVC)
# /external:I $ENV{CONDA_PREFIX}: consider the conda env prefix libraries headers as "external" to this project.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /DNOMINMAX /EHsc /Zc:__cplusplus /MP /experimental:external /external:I $ENV{CONDA_PREFIX}")
# Force release mode to avoid debug libraries to be linked
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The build type")
# add_definitions("-DUNICODE -D_UNICODE")
set(
CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL"
CACHE STRING "MSVC runtime library"
)
endif()

# Variants
Expand Down
1 change: 0 additions & 1 deletion libmamba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ macro(libmamba_create_target target_name linkage output_name)
elseif (WIN32)

set(CMAKE_PREFIX_PATH "$ENV{VCPKG_ROOT}/installed/x64-windows-static/")
set_target_properties(${target_name} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

# For Windows we have a vcpkg based build system right now.
find_package(LibArchive REQUIRED)
Expand Down
3 changes: 0 additions & 3 deletions mamba_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ mamba_target_add_compile_warnings(mamba-package WARNING_AS_ERROR ${MAMBA_WARNING

if (${MAMBA_PACKAGE_LINKAGE} STREQUAL "STATIC")
target_link_libraries(mamba-package PRIVATE libmamba-static)
if (WIN32)
set_target_properties(mamba-package PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif ()
else ()
target_link_libraries(mamba-package PRIVATE libmamba)
endif ()
Expand Down
3 changes: 0 additions & 3 deletions micromamba/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ message(STATUS "Micromamba linkage: ${MICROMAMBA_LINKAGE}")

if (${MICROMAMBA_LINKAGE} STREQUAL "STATIC")
target_link_libraries(micromamba PRIVATE libmamba-static)
if (WIN32)
set_target_properties(micromamba PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif ()
else ()
target_link_libraries(micromamba PRIVATE libmamba)
endif ()
Expand Down