Skip to content

Commit

Permalink
🐛 Fixed build with VS 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherFoxGuy committed Dec 3, 2021
1 parent e819bdd commit bfc6546
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions cmake/DependenciesConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions cmake/conan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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})
Expand All @@ -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()
Expand Down
7 changes: 7 additions & 0 deletions cmake/dependencies-helpers/CURL.cmake
Original file line number Diff line number Diff line change
@@ -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 ()

0 comments on commit bfc6546

Please # to comment.