CMake: msys compatibility added/fixed

This commit is contained in:
Syping 2024-03-06 16:20:47 +01:00
parent dd2de72f94
commit 6220277305
2 changed files with 15 additions and 5 deletions

View file

@ -98,12 +98,13 @@ if (WITH_DPP_AS_EXTERNAL_PROJECT)
add_dependencies(dtranslatebot DPP) add_dependencies(dtranslatebot DPP)
endif() endif()
target_compile_definitions(dtranslatebot PRIVATE target_compile_definitions(dtranslatebot PRIVATE
${DPP_DEFINITIONS}
$<$<BOOL:${DTRANSLATEBOT_USE_BOOST_REGEX}>:DTRANSLATEBOT_USE_BOOST_REGEX> $<$<BOOL:${DTRANSLATEBOT_USE_BOOST_REGEX}>:DTRANSLATEBOT_USE_BOOST_REGEX>
) )
if (MSVC AND MSVC_VERSION GREATER_EQUAL 1914) if (MSVC AND MSVC_VERSION GREATER_EQUAL 1914)
target_compile_options(dtranslatebot PRIVATE $<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>) target_compile_options(dtranslatebot PRIVATE $<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>)
endif() endif()
target_link_libraries(dtranslatebot PRIVATE ${DPP_LIBRARIES} ${DTRANSLATEBOT_LIBRARIES} Threads::Threads) target_link_libraries(dtranslatebot PRIVATE ${DTRANSLATEBOT_LIBRARIES} ${DPP_LIBRARIES} Threads::Threads)
target_include_directories(dtranslatebot PRIVATE ${DPP_INCLUDE_DIR}) target_include_directories(dtranslatebot PRIVATE ${DPP_INCLUDE_DIR})
set_target_properties(dtranslatebot PROPERTIES set_target_properties(dtranslatebot PROPERTIES
CXX_STANDARD 17 CXX_STANDARD 17

View file

@ -77,6 +77,7 @@ ExternalProject_Add(DPP
-DBUILD_VOICE_SUPPORT=OFF -DBUILD_VOICE_SUPPORT=OFF
"${CMAKE_PASSTHROUGH_ARGS}" "${CMAKE_PASSTHROUGH_ARGS}"
"-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>" "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
-DDPP_BUILD_TEST=OFF
-DDPP_NO_VCPKG=ON -DDPP_NO_VCPKG=ON
-DRUN_LDCONFIG=OFF -DRUN_LDCONFIG=OFF
"-DOpenSSL_ROOT=${OpenSSL_INSTALL_DIR}" "-DOpenSSL_ROOT=${OpenSSL_INSTALL_DIR}"
@ -91,13 +92,21 @@ set(DPP_LIBRARIES
-Wl,-Bstatic -Wl,-Bstatic
"-L${DPP_INSTALL_DIR}/lib" "-L${DPP_INSTALL_DIR}/lib"
"-L${DPP_INSTALL_DIR}/lib64" "-L${DPP_INSTALL_DIR}/lib64"
-ldpp dpp
"-L${OpenSSL_INSTALL_DIR}/lib" "-L${OpenSSL_INSTALL_DIR}/lib"
"-L${OpenSSL_INSTALL_DIR}/lib64" "-L${OpenSSL_INSTALL_DIR}/lib64"
-lssl ssl
-lcrypto crypto
"-L${ZLIB_INSTALL_DIR}/lib" "-L${ZLIB_INSTALL_DIR}/lib"
"-L${ZLIB_INSTALL_DIR}/lib64" "-L${ZLIB_INSTALL_DIR}/lib64"
-lz $<IF:$<BOOL:WIN32>,zlibstatic,z>
-Wl,-Bdynamic -Wl,-Bdynamic
) )
if (WIN32)
set(DPP_DEFINITIONS DPP_STATIC)
list(APPEND DPP_LIBRARIES
ws2_32
gdi32
crypt32
)
endif()