Skip to content

Commit

Permalink
Don't force MSVC_RUNTIME
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Sep 21, 2023
1 parent bb08805 commit f1b439b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/static_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,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
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(
MAKE_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

0 comments on commit f1b439b

Please sign in to comment.