1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 17:24:49 +02:00

Deduplicate some of the Windows extra module enabling code.

This commit is contained in:
Sadie Powell
2026-02-08 12:39:49 +00:00
parent bf5ab14a21
commit 76af25f0b4
+8 -8
View File
@@ -5,21 +5,21 @@ endif()
# enable extra modules if conan is used
if(WIN32 AND DEFINED CMAKE_TOOLCHAIN_FILE)
function(copy_extra NAME)
# copy the modules out of extra so it gets picked up by build_modules
message("Enabling the ${NAME} module")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/extra/${NAME}.cpp" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}")
endfunction()
function(enable_extra NAME PACKAGE)
find_package(${PACKAGE})
if(${PACKAGE}_FOUND)
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}")
copy_extra(${NAME})
else()
message("Unable to enable the ${NAME} module (missing library)")
message("Unable to enable the ${NAME} module (missing ${PACKAGE} library)")
endif()
endfunction()
function(copy_extra NAME)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/extra/${NAME}.cpp" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}")
endfunction()
enable_extra("enc_argon2" "argon2")
enable_extra("mysql" "libmysqlclient")
enable_extra("regex_pcre2" "PCRE2")