From bfc654669652d849cfa1da81bdfa6c4b0725be75 Mon Sep 17 00:00:00 2001 From: Edgar Date: Sun, 21 Nov 2021 12:17:57 +0100 Subject: [PATCH] :bug: Fixed build with VS 2022 --- CMakeLists.txt | 2 +- cmake/DependenciesConfig.cmake | 6 +++--- cmake/conan.cmake | 11 +++++++++-- cmake/dependencies-helpers/CURL.cmake | 7 +++++++ 4 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 cmake/dependencies-helpers/CURL.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c4fa459c05..3bfd26eb66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,7 @@ option(${_PREFIX}FORCE_SYSTEM_DEPENDENCIES "Force the use of system packages") if (WIN32) add_definitions("/D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /wd4251 /wd4275 /wd4099 /nologo") - set(CMAKE_CONFIGURATION_TYPES "Debug;Release") + set(CMAKE_CONFIGURATION_TYPES "Debug" "Release" CACHE STRING "Configuration types") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MP /GL /Ox /Ob2 /Oi /Ot /Oy /fp:fast /GS- /MP /Zi") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MP /Zi") diff --git a/cmake/DependenciesConfig.cmake b/cmake/DependenciesConfig.cmake index dca860da55..3be1134332 100644 --- a/cmake/DependenciesConfig.cmake +++ b/cmake/DependenciesConfig.cmake @@ -16,7 +16,7 @@ add_external_lib( add_external_lib( OpenAL - openal/1.19.1 + openal/1.21.1 REQUIRED PKG_CONFIG "openal >= 1.18" FIND_PACKAGE_OPTIONS CONFIG @@ -53,7 +53,7 @@ add_external_lib( add_external_lib( CURL - libcurl/7.69.1 + libcurl/7.79.1 PKG_CONFIG "libcurl >= 7.6" FIND_PACKAGE_OPTIONS CONFIG INTERFACE_NAME CURL::libcurl @@ -101,7 +101,7 @@ add_external_lib( add_external_lib( OpenSSL - openssl/1.1.1g + openssl/1.1.1l PKG_CONFIG "openssl >= 1.1.1" FIND_PACKAGE INTERFACE_NAME OpenSSL::SSL diff --git a/cmake/conan.cmake b/cmake/conan.cmake index cabb352ff5..0c458fbf5c 100644 --- a/cmake/conan.cmake +++ b/cmake/conan.cmake @@ -55,6 +55,8 @@ function(_get_msvc_ide_version result) set(${result} 15 PARENT_SCOPE) elseif(NOT MSVC_VERSION VERSION_LESS 1920 AND MSVC_VERSION VERSION_LESS 1930) set(${result} 16 PARENT_SCOPE) + elseif(NOT MSVC_VERSION VERSION_LESS 1930 AND MSVC_VERSION VERSION_LESS 1940) + set(${result} 17 PARENT_SCOPE) else() message(FATAL_ERROR "Conan: Unknown MSVC compiler version [${MSVC_VERSION}]") endif() @@ -126,6 +128,10 @@ macro(_conan_detect_compiler) set(_CONAN_SETTING_ARCH ${ARGUMENTS_ARCH}) endif() + if(USING_CXX) + set(_CONAN_SETTING_COMPILER_CPPSTD ${CMAKE_CXX_STANDARD}) + endif() + if (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL GNU) # using GCC # TODO: Handle other params @@ -415,7 +421,8 @@ endfunction() function(_collect_settings result) set(ARGUMENTS_PROFILE_AUTO arch build_type compiler compiler.version - compiler.runtime compiler.libcxx compiler.toolset) + compiler.runtime compiler.libcxx compiler.toolset + compiler.cppstd) foreach(ARG ${ARGUMENTS_PROFILE_AUTO}) string(TOUPPER ${ARG} _arg_name) string(REPLACE "." "_" _arg_name ${_arg_name}) @@ -426,7 +433,7 @@ function(_collect_settings result) set(${result} ${detected_setings} PARENT_SCOPE) endfunction() -function(conan_cmake_autodetect detected_settings ${ARGV}) +function(conan_cmake_autodetect detected_settings) _conan_detect_build_type(${ARGV}) _conan_check_system_name() _conan_check_language() diff --git a/cmake/dependencies-helpers/CURL.cmake b/cmake/dependencies-helpers/CURL.cmake new file mode 100644 index 0000000000..022e3ebd96 --- /dev/null +++ b/cmake/dependencies-helpers/CURL.cmake @@ -0,0 +1,7 @@ +# Fixup broken CURL target + +if (${_PREFIX}USE_CURL STREQUAL "CONAN") + if (NOT TARGET CURL::libcurl) + add_library(CURL::libcurl ALIAS CONAN_PKG::CURL) + endif () +endif () \ No newline at end of file