From 2080a6adc068431f4d1d0426bc105f2ef6f801bb Mon Sep 17 00:00:00 2001
From: Lars Bilke <lars.bilke@ufz.de>
Date: Mon, 14 Feb 2022 16:35:00 +0100
Subject: [PATCH] [CMake,BL,PL] Fixes for BUILD_SHARED_LIBS=ON on Windows.

---
 BaseLib/Logging.h                 | 4 +++-
 ChemistryLib/CMakeLists.txt       | 2 +-
 ProcessLib/CMakeLists.txt         | 2 +-
 ProcessLib/DeactivatedSubdomain.h | 4 +++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/BaseLib/Logging.h b/BaseLib/Logging.h
index 2364359fac1..f2de07f271d 100644
--- a/BaseLib/Logging.h
+++ b/BaseLib/Logging.h
@@ -16,9 +16,11 @@
 #include <memory>
 #include <string>
 
+#include "baselib_export.h"
+
 namespace BaseLib
 {
-extern std::shared_ptr<spdlog::logger> console;
+extern BASELIB_EXPORT std::shared_ptr<spdlog::logger> console;
 void setConsoleLogLevel(std::string const& level_string);
 
 }  // namespace BaseLib
diff --git a/ChemistryLib/CMakeLists.txt b/ChemistryLib/CMakeLists.txt
index 05fe2429d3b..1c0f7a880c4 100644
--- a/ChemistryLib/CMakeLists.txt
+++ b/ChemistryLib/CMakeLists.txt
@@ -8,7 +8,7 @@ append_source_files(SOURCES Common)
 ogs_add_library(ChemistryLib ${SOURCES})
 
 target_link_libraries(
-    ChemistryLib PUBLIC Eigen3::Eigen iphreeqc PRIVATE BaseLib NumLib
+    ChemistryLib PUBLIC Eigen3::Eigen iphreeqc PRIVATE BaseLib MaterialLib NumLib
 )
 
 # See https://github.com/ufz/ogs/pull/2982#issuecomment-641086788
diff --git a/ProcessLib/CMakeLists.txt b/ProcessLib/CMakeLists.txt
index 97de8fc0a26..c0a87540151 100644
--- a/ProcessLib/CMakeLists.txt
+++ b/ProcessLib/CMakeLists.txt
@@ -14,7 +14,7 @@ append_source_files(SOURCES SurfaceFlux)
 append_source_files(SOURCES Output)
 append_source_files(SOURCES Utils)
 
-ogs_add_library(ProcessLib ${SOURCES})
+ogs_add_library(ProcessLib GENERATE_EXPORT_HEADER ${SOURCES})
 
 if(OGS_USE_PYTHON)
     add_subdirectory(BoundaryConditionAndSourceTerm/Python)
diff --git a/ProcessLib/DeactivatedSubdomain.h b/ProcessLib/DeactivatedSubdomain.h
index 686a0b68cfc..7a6ac8338ea 100644
--- a/ProcessLib/DeactivatedSubdomain.h
+++ b/ProcessLib/DeactivatedSubdomain.h
@@ -20,6 +20,8 @@
 #include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h"
 #include "MathLib/Point3d.h"
 
+#include "processlib_export.h"
+
 namespace MeshLib
 {
 class Mesh;
@@ -102,6 +104,6 @@ struct DeactivatedSubdomain
     /// the surface of the deactivated subdomain/excavation.
     ParameterLib::Parameter<double> const* const boundary_value_parameter;
 
-    static const std::string zero_parameter_name;
+    PROCESSLIB_EXPORT static const std::string zero_parameter_name;
 };
 }  // namespace ProcessLib
-- 
GitLab