summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@sigterm.info>2023-06-02 18:20:19 -0400
committerAdam <Adam@sigterm.info>2023-06-02 19:08:55 -0400
commit07babdbd77f1978f8386791272b309949e56a09b (patch)
tree04145b62c3cf5ded5a0d5fab4afc2e96b44fbfcb /modules
parentfe3926f572dc25557be0119b6c35da752365bf48 (diff)
use Conan for extra's dependencies on Windows
conan install src\win32\conanfile.txt --build=missing cmake -B build . cmake --build build --config Release --target PACKAGE
Diffstat (limited to 'modules')
-rw-r--r--modules/CMakeLists.txt33
-rw-r--r--modules/extra/m_regex_pcre2.cpp2
-rw-r--r--modules/extra/m_ssl_openssl.cpp2
3 files changed, 35 insertions, 2 deletions
diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt
index 4b0fd6eec..0553cad1c 100644
--- a/modules/CMakeLists.txt
+++ b/modules/CMakeLists.txt
@@ -3,6 +3,39 @@ if(WIN32)
add_definitions(-DMODULE_COMPILE)
endif(WIN32)
+# enable extra modules if conan is used
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../conanbuildinfo.cmake")
+ include("${CMAKE_CURRENT_SOURCE_DIR}/../conanbuildinfo.cmake")
+ conan_basic_setup()
+
+ function(enable_extra NAME PACKAGE)
+ if(DEFINED "CONAN_${PACKAGE}_ROOT")
+ message("Enabling the ${NAME} module")
+ # copy the modules out of extra so it gets picked up by build_modules
+ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/extra/${NAME}.cpp" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}")
+ else()
+ message("Unable to enable the ${NAME} module (missing library)")
+ endif()
+ endfunction()
+
+ function(copy_extra NAME)
+ file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/extra/${NAME}.cpp" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}")
+ endfunction()
+
+ enable_extra("m_mysql" "LIBMYSQLCLIENT")
+ enable_extra("m_regex_pcre2" "PCRE2")
+ enable_extra("m_sqlite" "SQLITE3")
+ enable_extra("m_ssl_openssl" "OPENSSL")
+ # these don't actually have extra dependencies, but require a module which does
+ copy_extra("m_sql_authentication")
+ copy_extra("m_sql_log")
+ copy_extra("m_sql_oper")
+
+ # Package extra dlls
+ file(GLOB EXTRA_DLLS "${Anope_SOURCE_DIR}/extradll/bin/*.dll" "${Anope_SOURCE_DIR}/extradll/lib/*.dll")
+ install(FILES ${EXTRA_DLLS} DESTINATION ${BIN_DIR})
+endif()
+
macro(build_modules SRC)
if(NOT ${SRC} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} AND EXISTS "${SRC}/CMakeLists.txt")
add_subdirectory("${SRC}")
diff --git a/modules/extra/m_regex_pcre2.cpp b/modules/extra/m_regex_pcre2.cpp
index b9db11c2c..5655c3324 100644
--- a/modules/extra/m_regex_pcre2.cpp
+++ b/modules/extra/m_regex_pcre2.cpp
@@ -7,7 +7,7 @@
*/
/* RequiredLibraries: pcre2-8 */
-/* RequiredWindowsLibraries: libpcre2-8 */
+/* RequiredWindowsLibraries: pcre2-8 */
#include "module.h"
diff --git a/modules/extra/m_ssl_openssl.cpp b/modules/extra/m_ssl_openssl.cpp
index a73f144dd..26b47a330 100644
--- a/modules/extra/m_ssl_openssl.cpp
+++ b/modules/extra/m_ssl_openssl.cpp
@@ -7,7 +7,7 @@
*/
/* RequiredLibraries: ssl,crypto */
-/* RequiredWindowsLibraries: ssleay32,libeay32 */
+/* RequiredWindowsLibraries: libssl,libcrypto */
#include "module.h"
#include "modules/ssl.h"