diff --git a/CMakeLists.txt b/CMakeLists.txt index d7da1338daf..fdbe4a4141a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,6 +229,26 @@ if (HAS_CXXFLAG_FSTACK_CLASH_PROTECTION AND NOT (MINGW OR APPLE)) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-clash-protection") endif() +# Global floating-point compiler settings +if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + # Enable -ffp-contract=off (if supported) + check_c_compiler_flag(-ffp-contract=off HAS_CFLAG_FFP_CONTRACT_OFF) + if (HAS_CFLAG_FFP_CONTRACT_OFF) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffp-contract=off") + endif() +elseif (CMAKE_C_COMPILER_ID STREQUAL "MSVC") + # MSVC defaults to /fp:precise +endif() +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + check_cxx_compiler_flag(-ffp-contract=off HAS_CXXFLAG_FFP_CONTRACT_OFF) + if (HAS_CXXFLAG_FFP_CONTRACT_OFF) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffp-contract=off") + endif() +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # MSVC defaults to /fp:precise +endif() + + include(CheckCompilerFlagsOutput) set(WZ_TARGET_ADDITIONAL_PROPERTIES) # Set below to any additional properties that should be added to Warzone targets (src/, lib/*/) diff --git a/configure_mac.cmake b/configure_mac.cmake index d1f38e66d24..c93abb10ecf 100644 --- a/configure_mac.cmake +++ b/configure_mac.cmake @@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 3.5) ######################################################## # To ensure reproducible builds, pin to a specific vcpkg commit -set(VCPKG_COMMIT_SHA "0f8a0f084a8d1bf35700dd797ae5e4bb8aa52f1a") +set(VCPKG_COMMIT_SHA "51475feaccb720ab40e5a0e3f8da70a4510defc0") # WZ minimum supported macOS deployment target (< 10.9 is untested) set(MIN_SUPPORTED_MACOSX_DEPLOYMENT_TARGET "10.9") diff --git a/get-dependencies_win.ps1 b/get-dependencies_win.ps1 index 5a899337952..77f881d78e8 100755 --- a/get-dependencies_win.ps1 +++ b/get-dependencies_win.ps1 @@ -5,7 +5,7 @@ param([string]$VCPKG_BUILD_TYPE = "") ############################ # To ensure reproducible builds, pin to a specific vcpkg commit -$VCPKG_COMMIT_SHA = "0f8a0f084a8d1bf35700dd797ae5e4bb8aa52f1a"; +$VCPKG_COMMIT_SHA = "51475feaccb720ab40e5a0e3f8da70a4510defc0"; # WZ Windows features (for vcpkg install) $VCPKG_INSTALL_FEATURES = @() diff --git a/src/main.cpp b/src/main.cpp index 0ac9c4f4a20..ad813637b5e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1371,6 +1371,15 @@ bool getUTF8CmdLine(int *const _utfargc WZ_DECL_UNUSED, char *** const _utfargv #if defined(WZ_OS_WIN) +// Special exports to default to high-performance GPU on multi-GPU systems +extern "C" { + // https://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf + __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; + + // https://gpuopen.com/learn/amdpowerxpressrequesthighperformance/ + __declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001; +} + typedef BOOL (WINAPI *SetDefaultDllDirectoriesFunction)( DWORD DirectoryFlags ); diff --git a/src/urlrequest.cpp b/src/urlrequest.cpp index 5ae28d2ff19..6d9e41065b8 100644 --- a/src/urlrequest.cpp +++ b/src/urlrequest.cpp @@ -1270,7 +1270,7 @@ void urlSelectSSLBackend() return; } // Note: Use CURLSSLBACKEND_DARWINSSL instead of CURLSSLBACKEND_SECURETRANSPORT to support older cURL versions - const std::vector backendPreferencesOrder = {CURLSSLBACKEND_SCHANNEL, CURLSSLBACKEND_DARWINSSL, CURLSSLBACKEND_GNUTLS, CURLSSLBACKEND_NSS}; + const std::vector backendPreferencesOrder = {CURLSSLBACKEND_SCHANNEL, CURLSSLBACKEND_DARWINSSL, CURLSSLBACKEND_GNUTLS}; std::vector ignoredBackends; #if !defined(USE_OPENSSL_LOCKS_INIT) && !defined(CURL_OPENSSL_DOES_NOT_REQUIRE_LOCKS_INIT) // Did not compile with support for thread-safety / locks for OpenSSL, so ignore it diff --git a/vcpkg.json b/vcpkg.json index b6a8610c9d3..1659e31bee8 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,7 +1,7 @@ { "name": "warzone2100", "version-string": "master-branch", - "builtin-baseline": "6d16cb553a82eb42548326769f0a16d74fbceec1", + "builtin-baseline": "51475feaccb720ab40e5a0e3f8da70a4510defc0", "dependencies": [ "sdl2", "physfs", @@ -14,15 +14,7 @@ "libpng", "freetype", "gettext", - { - "name": "openal-soft", - "platform": "windows | mingw" - }, - { - "name": "openal-soft", - "platform": "!windows & !mingw", - "version>=": "1.23.0" - }, + "openal-soft", "zlib", "sqlite3", "libsodium",