From 71841b747d41a8efca1998aa950c89b034f8d46d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 7 Jun 2021 04:33:14 +0100 Subject: Migrate Windows builds to installing their dependencies via Conan. --- win/conanfile.txt | 34 ++++++++++++++++++++++++++++++++++ win/modules/CMakeLists.txt | 24 ++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 win/conanfile.txt (limited to 'win') diff --git a/win/conanfile.txt b/win/conanfile.txt new file mode 100644 index 000000000..61a25f345 --- /dev/null +++ b/win/conanfile.txt @@ -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 diff --git a/win/modules/CMakeLists.txt b/win/modules/CMakeLists.txt index 2c2617e2b..a2c70e352 100644 --- a/win/modules/CMakeLists.txt +++ b/win/modules/CMakeLists.txt @@ -2,6 +2,26 @@ # so copy the file out of extra/ file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_stdlib.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/") +if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") + file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_argon2.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/") + file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_pgsql.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/") + file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_mysql.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/") + file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_pcre.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/") + file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_regex_re2.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/") + file(COPY "${INSPIRCD_BASE}/src/modules/extra/m_sqlite3.cpp" DESTINATION "${INSPIRCD_BASE}/src/modules/") + + include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") + link_directories("${CMAKE_BINARY_DIR}/extradll" "${CMAKE_BINARY_DIR}/extralib") + + file(GLOB EXTRA_DLLS "${CMAKE_BINARY_DIR}/extradll/*.dll") + install(FILES ${EXTRA_DLLS} DESTINATION .) + + conan_basic_setup(TARGETS) +else() + message("Unable to build extras: conanbuildinfo.cmake does not exist in the build directory!") +endif() + + file(GLOB INSPIRCD_MODULES "${INSPIRCD_BASE}/src/coremods/core_*" "${INSPIRCD_BASE}/src/modules/m_*") list(SORT INSPIRCD_MODULES) @@ -31,6 +51,10 @@ foreach(MODULE_NAME ${INSPIRCD_MODULES}) add_dependencies(${SO_NAME} win32_memory) endif(MSVC) + if(CONAN_CXX_FLAGS) + conan_target_link_libraries("${SO_NAME}") + endif() + set_target_properties(${SO_NAME} PROPERTIES PREFIX "" SUFFIX "" -- cgit v1.2.3