]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Migrate Windows builds to installing their dependencies via Conan.
authorSadie Powell <sadie@witchery.services>
Mon, 7 Jun 2021 03:33:14 +0000 (04:33 +0100)
committerSadie Powell <sadie@witchery.services>
Mon, 7 Jun 2021 03:46:32 +0000 (04:46 +0100)
src/modules/extra/m_mysql.cpp
src/modules/extra/m_regex_pcre.cpp
win/conanfile.txt [new file with mode: 0644]
win/modules/CMakeLists.txt

index 377ffee7e026e10553a93da519fdc7a79828c30f..64a460f7733992146bcf8df75bf0ddec7ef82fec 100644 (file)
@@ -56,7 +56,7 @@
 #endif
 
 #ifdef _WIN32
-# pragma comment(lib, "libmysql.lib")
+# pragma comment(lib, "mysqlclient.lib")
 #endif
 
 /* VERSION 3 API: With nonblocking (threaded) requests */
index 17cc65bd3797b9ced6712c6d29b562a2febbc81e..6c5ecb83f0391f60df1479b331bd032e5565e32e 100644 (file)
@@ -38,7 +38,7 @@
 #include "modules/regex.h"
 
 #ifdef _WIN32
-# pragma comment(lib, "libpcre.lib")
+# pragma comment(lib, "pcre.lib")
 #endif
 
 class PCRERegex : public Regex
diff --git a/win/conanfile.txt b/win/conanfile.txt
new file mode 100644 (file)
index 0000000..61a25f3
--- /dev/null
@@ -0,0 +1,34 @@
+# Last updated: 2020-06-07
+#
+# Modules we can't legally ship: geo_maxmind, ssl_mbedtls, ssl_openssl
+# Modules which don't apply to Windows: regex_posix, sslrehashsgnal
+# Modules without packages: ldap, regex_tre, ssl_gnutls
+
+[requires]
+argon2/20190702
+# libmaxminddb/1.6.0
+libpq/13.2
+# mbedtls/2.25.0
+mysql-connector-c/6.1.11
+# openssl/1.1.1k
+pcre/8.44
+re2/20210401
+sqlite3/3.35.5
+
+[options]
+argon2:shared=True
+# libmaxminddb:shared=True
+libpq:shared=True
+# mbedtls:shared=True
+mysql-connector:shared=True
+# openssl:shared=True
+pcre:shared=True
+re2:shared=True
+sqlite3:shared=True
+
+[imports]
+., *.dll -> extradll @ keep_path=False
+., *.lib -> extralib @ keep_path=False
+
+[generators]
+cmake
index 2c2617e2b44e194b1913a93169303cc473ce6737..a2c70e3522ef94a82ef42c6554bc59495fd2a928 100644 (file)
@@ -2,6 +2,26 @@
 # so copy the file out of extra/\r
 file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_stdlib.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")\r
 \r
+if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")\r
+       file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_argon2.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")\r
+       file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_pgsql.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")\r
+       file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_mysql.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")\r
+       file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_pcre.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")\r
+       file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_re2.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")\r
+       file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_sqlite3.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/")\r
+\r
+       include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")\r
+       link_directories("${CMAKE_BINARY_DIR}/extradll" "${CMAKE_BINARY_DIR}/extralib")\r
+\r
+       file(GLOB EXTRA_DLLS "${CMAKE_BINARY_DIR}/extradll/*.dll")\r
+       install(FILES ${EXTRA_DLLS} DESTINATION .)\r
+\r
+       conan_basic_setup(TARGETS)\r
+else()\r
+       message("Unable to build extras: conanbuildinfo.cmake does not exist in the build directory!")\r
+endif()\r
+\r
+\r
 file(GLOB INSPIRCD_MODULES "${INSPIRCD_BASE}/src/coremods/core_*" "${INSPIRCD_BASE}/src/modules/m_*")\r
 list(SORT INSPIRCD_MODULES)\r
 \r
@@ -31,6 +51,10 @@ foreach(MODULE_NAME ${INSPIRCD_MODULES})
                add_dependencies(${SO_NAME} win32_memory)\r
        endif(MSVC)\r
 \r
+       if(CONAN_CXX_FLAGS)\r
+               conan_target_link_libraries("${SO_NAME}")\r
+       endif()\r
+\r
        set_target_properties(${SO_NAME} PROPERTIES\r
                PREFIX ""\r
                SUFFIX ""\r