From 0ae30b050fba6f886e9e10c7d42f214326d4e4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaim=20=28Jo=C3=ABl=20Lamotte=29?= <142265+Klaim@users.noreply.github.com> Date: Thu, 14 Aug 2025 16:16:47 +0200 Subject: [PATCH 1/3] cmake fixes for windows-conda builds - glog requires a define to compile; - removed warnings because of overriding `/MD` with `/MT` when we are building dlls; --- cpp/CMakeLists.txt | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index bc35614143..7ee732cc1f 100755 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -74,6 +74,12 @@ if(ARCTICDB_SANITIZER_FLAGS) message(STATUS "Building ArcticDB with sanitizers. Compiler flags: ${ARCTICDB_SANITIZER_FLAGS}") endif() +if(${ARCTICDB_USING_CONDA}) + # Required to be able to include headers from glog since glog 0.7 + # See: https://github.com/google/glog/pull/1030 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLOG_USE_GLOG_EXPORT") +endif() + if(WIN32) add_compile_definitions( NOGDI WIN32_LEAN_AND_MEAN HAVE_SNPRINTF NOMINMAX @@ -85,9 +91,22 @@ if(WIN32) # Guide to MSVC compilation warnings https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-c4000-through-c4199?view=msvc-170 add_compile_options( /DWIN32 /D_WINDOWS /GR /EHsc /bigobj /Z7 /wd4244 /wd4267 - "$<$:/Od;/MTd>" - "$<$:/MT;/Ox>" ) + + if(${ARCTICDB_USING_CONDA}) + # Conda builds use dynamic linkage + add_compile_options( + "$<$:/MDd>" + "$<$:/MD;/Ox>" + ) + else() + # PyPI builds use static linkage + add_compile_options( + "$<$:/Od;/MTd>" + "$<$:/MT;/Ox>" + ) + endif() + if(${ARCTICDB_MSVC_OMIT_RUNTIME_CHECKS}) message(STATUS "Removing MSVC runtime checks") foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) @@ -96,9 +115,7 @@ if(WIN32) endif() else() if(${ARCTICDB_USING_CONDA}) - # Required to be able to include headers from glog since glog 0.7 - # See: https://github.com/google/glog/pull/1030 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -DGLOG_USE_GLOG_EXPORT") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") endif() From d68fa1abcb6415c757a27a9f9112a814bd8fa574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaim=20=28Jo=C3=ABl=20Lamotte=29?= <142265+Klaim@users.noreply.github.com> Date: Thu, 14 Aug 2025 16:17:14 +0200 Subject: [PATCH 2/3] cmake preset for conda use build type RelWithDebInfo by default --- cpp/CMakePresets.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/CMakePresets.json b/cpp/CMakePresets.json index 96dee492fd..859ecba8f7 100644 --- a/cpp/CMakePresets.json +++ b/cpp/CMakePresets.json @@ -86,7 +86,10 @@ }, { "name": "windows-cl-conda-debug", - "inherits": ["common_conda", "windows"] + "inherits": ["common_conda", "windows"], + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } }, { From d3334677b5850c0765710b091ee02a785b3219f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaim=20=28Jo=C3=ABl=20Lamotte=29?= <142265+Klaim@users.noreply.github.com> Date: Thu, 21 Aug 2025 15:07:53 +0200 Subject: [PATCH 3/3] makes conda env. libs available when using conda - worksaround boost autolinking issue with msvc --- cpp/arcticdb/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpp/arcticdb/CMakeLists.txt b/cpp/arcticdb/CMakeLists.txt index 0fc55139c3..a63e104105 100644 --- a/cpp/arcticdb/CMakeLists.txt +++ b/cpp/arcticdb/CMakeLists.txt @@ -85,6 +85,11 @@ else() set(Zstd_LIBRARY zstd::libzstd_shared) + # Make sure libraries using auto-linking (Boost) are found when using a Conda env + if(MSVC) + link_directories("$ENV{CONDA_PREFIX}/Library/lib/") + endif() + endif() if(${ARCTICDB_USING_CONDA} OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")