]> git.stg.codes - stg.git/commitdiff
Check if we can use C++17 with XMLRPC-C.
authorMaksym Mamontov <madf@madf.info>
Mon, 22 Aug 2022 14:44:46 +0000 (17:44 +0300)
committerMaksym Mamontov <madf@madf.info>
Mon, 22 Aug 2022 14:44:46 +0000 (17:44 +0300)
checks/xmlrpc-c-auto_ptr.cpp [new file with mode: 0644]
projects/stargazer/plugins/CMakeLists.txt

diff --git a/checks/xmlrpc-c-auto_ptr.cpp b/checks/xmlrpc-c-auto_ptr.cpp
new file mode 100644 (file)
index 0000000..b47c9e6
--- /dev/null
@@ -0,0 +1,6 @@
+#include <xmlrpc-c/girmem.hpp>
+
+int main()
+{
+    return 0;
+}
index 2b5c0467ac15e2505b8fcb6792ffe31cae44631d..8adb6c5f9d5685f244607f7b13a996651a03a53a 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 1.54 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