]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/CMakeLists.txt
Merge remote-tracking branch 'github/master'
[stg.git] / projects / stargazer / plugins / CMakeLists.txt
index e1e78e109174e4daf72d5d788288663ce214f439..fc378ba6bff46819fbefd70e20a4acde24cae898 100644 (file)
@@ -138,7 +138,12 @@ if ( BUILD_MOD_SGCONFIG )
 endif ( BUILD_MOD_SGCONFIG )
 
 if ( BUILD_MOD_RPCCONFIG )
 endif ( BUILD_MOD_SGCONFIG )
 
 if ( BUILD_MOD_RPCCONFIG )
-    find_package ( XMLRPC REQUIRED c++ abyss-server )
+    find_package ( XMLRPC 1.58.0 REQUIRED c++2 abyss-server )
+    try_compile ( XMLRPC_C_NO_AUTO_PTR ${CMAKE_CURRENT_BINARY_DIR} "${PROJECT_SOURCE_DIR}/checks/xmlrpc-c-auto_ptr.cpp" CMAKE_FLAGS -DINCLUDE_DIRECTORIES=${XMLRPC_INCLUDE_DIRS} LINK_LIBRARIES ${XMLRPC_LIBRARIES} OUTPUT_VARIABLE TRY_COMPILE_OUTPUT )
+    if ( NOT XMLRPC_C_NO_AUTO_PTR )
+        message ( WARNING ${TRY_COMPILE_OUTPUT} )
+        message ( FATAL_ERROR "Your version of XMLRPC-C library can not be used with C++17. Try upgrading to at least 1.58.0." )
+    endif ()
     include_directories ( ${XMLRPC_INCLUDE_DIRS} )
     add_library ( mod_conf_rpc MODULE configuration/rpcconfig/rpcconfig.cpp
                                       configuration/rpcconfig/user_helper.cpp
     include_directories ( ${XMLRPC_INCLUDE_DIRS} )
     add_library ( mod_conf_rpc MODULE configuration/rpcconfig/rpcconfig.cpp
                                       configuration/rpcconfig/user_helper.cpp
@@ -148,8 +153,11 @@ if ( BUILD_MOD_RPCCONFIG )
                                       configuration/rpcconfig/tariffs_methods.cpp
                                       configuration/rpcconfig/admins_methods.cpp
                                       configuration/rpcconfig/messages_methods.cpp )
                                       configuration/rpcconfig/tariffs_methods.cpp
                                       configuration/rpcconfig/admins_methods.cpp
                                       configuration/rpcconfig/messages_methods.cpp )
-                              target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} )
+    target_link_libraries ( mod_conf_rpc scriptexecuter logger common ${XMLRPC_LIBRARIES} )
     set_target_properties ( mod_conf_rpc PROPERTIES PREFIX "" )
     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}" )
 
     if ( CLANG_TIDY_EXE )
         set_target_properties ( mod_conf_rpc PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )
@@ -267,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 "" )
                                               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}" )
 
     if ( CLANG_TIDY_EXE )
         set_target_properties ( mod_store_postgresql PROPERTIES CXX_CLANG_TIDY "${DO_CLANG_TIDY}" )