Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various build tweaks, vcpkg updates #3406

Merged
merged 6 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/*/)
Expand Down
2 changes: 1 addition & 1 deletion configure_mac.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion get-dependencies_win.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @()
Expand Down
9 changes: 9 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
2 changes: 1 addition & 1 deletion src/urlrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ void urlSelectSSLBackend()
return;
}
// Note: Use CURLSSLBACKEND_DARWINSSL instead of CURLSSLBACKEND_SECURETRANSPORT to support older cURL versions
const std::vector<curl_sslbackend> backendPreferencesOrder = {CURLSSLBACKEND_SCHANNEL, CURLSSLBACKEND_DARWINSSL, CURLSSLBACKEND_GNUTLS, CURLSSLBACKEND_NSS};
const std::vector<curl_sslbackend> backendPreferencesOrder = {CURLSSLBACKEND_SCHANNEL, CURLSSLBACKEND_DARWINSSL, CURLSSLBACKEND_GNUTLS};
std::vector<curl_sslbackend> 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
Expand Down
12 changes: 2 additions & 10 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "warzone2100",
"version-string": "master-branch",
"builtin-baseline": "6d16cb553a82eb42548326769f0a16d74fbceec1",
"builtin-baseline": "51475feaccb720ab40e5a0e3f8da70a4510defc0",
"dependencies": [
"sdl2",
"physfs",
Expand All @@ -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",
Expand Down
Loading