diff --git a/CMakeLists.txt b/CMakeLists.txt
index 22712a3d62f848c7e582e6cb7f4e7efe940383d1..4ed32f2c7a1710934cf520da52f1adb4f16c76f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -30,6 +30,12 @@ add_library(
 
 add_library(EvalHyd::evalhyd ALIAS evalhyd)
 
+set_target_properties(
+        evalhyd
+        PROPERTIES
+                VISIBILITY_INLINES_HIDDEN ON
+)
+
 target_include_directories(
         evalhyd
         PUBLIC
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 02690d49cb1948f2aa16dc378c98fa32b31a544e..eb0ffa74d796b7820d5e722453d3549175276e2c 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -15,6 +15,13 @@ add_executable(
         test_uncertainty.cpp
 )
 
+set_target_properties(
+        evalhyd_tests
+        PROPERTIES
+                VISIBILITY_INLINES_HIDDEN ON
+                CXX_VISIBILITY_PRESET hidden
+)
+
 target_include_directories(
         evalhyd_tests
         PRIVATE