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() 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" + } }, { 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")