@@ -75,20 +75,82 @@ if(ARCTICDB_SANITIZER_FLAGS)
7575 message (STATUS "Building ArcticDB with sanitizers. Compiler flags: ${ARCTICDB_SANITIZER_FLAGS} " )
7676endif ()
7777
78+ if (${ARCTICDB_USING_CONDA} )
79+ # Required to be able to include headers from glog since glog 0.7
80+ # See: https://github.com/google/glog/pull/1030
81+ add_compile_definitions (GLOG_USE_GLOG_EXPORT)
82+ endif ()
83+
7884if (WIN32 )
7985 add_compile_definitions (
8086 NOGDI WIN32_LEAN_AND_MEAN HAVE_SNPRINTF NOMINMAX
8187 "$<$<CONFIG:Debug>:DEBUG_BUILD>"
8288 )
89+ if (${ARCTICDB_USING_CONDA} )
90+ add_compile_definitions (
91+ # Required to link against zstd.dll
92+ # See: https://github.com/facebook/zstd/blob/dev/lib/zstd.h#L47-L53
93+ ZSTD_DLL_IMPORT=1
94+
95+ # Required to link against lz4.dll
96+ # See: https://github.com/lz4/lz4/blob/dev/lib/lz4frame.h#L79-L85
97+ LZ4_DLL_IMPORT=1
98+
99+ # Required to link against protobuf.dll
100+ # See: https://github.com/protocolbuffers/protobuf/blob/384fabf35a9b5d1f1502edaf9a139b1f51551a01/cmake/README.md?plain=1#L296-L319
101+ PROTOBUF_USE_DLLS=1
102+
103+ # Required to link against fmt.dll
104+ FMT_SHARED=1
105+
106+ # Required to link against spdlog.dll
107+ # See: https://github.com/gabime/spdlog/blob/faa0a7a9c5a3550ed5461fab7d8e31c37fd1a2ef/include/spdlog/common.h#L28-L48
108+ SPDLOG_COMPILED_LIB=1
109+ SPDLOG_SHARED_LIB=1
110+ SPDLOG_HEADER_ONLY=0
111+
112+ # Indicate that we are building using fmt's external DLL instead of spdlog's internal fmt
113+ SPDLOG_FMT_EXTERNAL=1
114+
115+ # Required to link against azure-core.dll
116+ # See: https://github.com/Azure/azure-sdk-for-cpp/blob/c914c0933fa4835c6618a42bb276d6077423b170/sdk/storage/azure-storage-common/inc/azure/storage/common/dll_import_export.hpp#L19
117+ AZ_CORE_DLL=1
118+
119+ # Required to link against azure-identity.dll
120+ # See: https://github.com/Azure/azure-sdk-for-cpp/blob/bf36db827f5ea1ef2e38953875c6c335b4242b2e/sdk/identity/azure-identity/inc/azure/identity/dll_import_export.hpp
121+ AZ_IDENTITY_DLL=1
122+
123+ # Required to link against azure-storage-common.dll
124+ # See: https://github.com/Azure/azure-sdk-for-cpp/blob/c914c0933fa4835c6618a42bb276d6077423b170/sdk/storage/azure-storage-common/inc/azure/storage/common/dll_import_export.hpp#L19
125+ AZ_STORAGE_COMMON_DLL=1
126+
127+ # Required to link against azure-storage-blobs.dll
128+ # See: https://github.com/Azure/azure-sdk-for-cpp/blob/bf36db827f5ea1ef2e38953875c6c335b4242b2e/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/dll_import_export.hpp
129+ AZ_STORAGE_BLOBS_DLL=1
130+ )
131+ endif ()
83132
84133 # We always generate the debug info on Windows since those are not in the final .dll.
85134 # sccache needs the /Z7 format, but the linker will still produce .pdb files.
86135 # Guide to MSVC compilation warnings https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warnings-c4000-through-c4199?view=msvc-170
87136 add_compile_options (
88137 /DWIN32 /D_WINDOWS /GR /EHsc /bigobj /Z7 /wd4244 /wd4267
89- "$<$<CONFIG:Debug>:/Od;/MTd>"
90- "$<$<CONFIG:Release>:/MT;/Ox>"
91138 )
139+
140+ if (${ARCTICDB_USING_CONDA} )
141+ # Conda builds use dynamic linkage
142+ add_compile_options (
143+ "$<$<CONFIG:Debug>:/MDd>"
144+ "$<$<CONFIG:Release>:/MD;/Ox>"
145+ )
146+ else ()
147+ # PyPI builds use static linkage
148+ add_compile_options (
149+ "$<$<CONFIG:Debug>:/Od;/MTd>"
150+ "$<$<CONFIG:Release>:/MT;/Ox>"
151+ )
152+ endif ()
153+
92154 if (${ARCTICDB_MSVC_OMIT_RUNTIME_CHECKS} )
93155 message (STATUS "Removing MSVC runtime checks" )
94156 foreach (flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO )
@@ -97,9 +159,7 @@ if(WIN32)
97159 endif ()
98160else ()
99161 if (${ARCTICDB_USING_CONDA} )
100- # Required to be able to include headers from glog since glog 0.7
101- # See: https://github.com/google/glog/pull/1030
102- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -DGLOG_USE_GLOG_EXPORT" )
162+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra" )
103163 else ()
104164 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra" )
105165 endif ()
0 commit comments