From: Maksym Mamontov <madf@madf.info>
Date: Wed, 28 Dec 2022 14:32:34 +0000 (+0200)
Subject: Fix build on Darwin.
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/1cb912e4f90473f78d2f0f10ab5c9b2c5bd36440

Fix build on Darwin.
---

diff --git a/projects/stargazer/plugins/CMakeLists.txt b/projects/stargazer/plugins/CMakeLists.txt
index 8adb6c5f..fc378ba6 100644
--- a/projects/stargazer/plugins/CMakeLists.txt
+++ b/projects/stargazer/plugins/CMakeLists.txt
@@ -155,6 +155,9 @@ if ( BUILD_MOD_RPCCONFIG )
                                       configuration/rpcconfig/messages_methods.cpp )
     target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} )
     set_target_properties ( mod_conf_rpc PROPERTIES PREFIX "" )
+    if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
+        set_target_properties ( mod_conf_rpc PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
+    endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
 
     if ( CLANG_TIDY_EXE )
         set_target_properties ( mod_conf_rpc PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
@@ -272,6 +275,9 @@ if ( BUILD_MOD_STORE_POSTGRESQL )
                                               store/postgresql/postgresql_store_utils.cpp )
                                       target_link_libraries ( mod_store_postgresql crypto logger common ${PostgreSQL_LIBRARIES} )
     set_target_properties ( mod_store_postgresql PROPERTIES PREFIX "" )
+    if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
+        set_target_properties ( mod_store_postgresql PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
+    endif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" )
 
     if ( CLANG_TIDY_EXE )
         set_target_properties ( mod_store_postgresql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )