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 updates #3420

Merged
merged 5 commits into from
Oct 15, 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: 0 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,26 +229,6 @@ 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
24 changes: 6 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ How to get the latest Ubuntu development builds:
2. Select the latest workflow run in the table / list.
This should display a list of **Artifacts** from the run.
3. Download the appropriate `warzone2100_ubuntu<version>_amd64_deb` artifact.
- If you are running Ubuntu 18.04: `warzone2100_ubuntu18.04_amd64_deb`
- If you are running Ubuntu 20.04: `warzone2100_ubuntu20.04_amd64_deb`
- If you are running Ubuntu 22.04: `warzone2100_ubuntu22.04_amd64_deb`
> Note: A free GitHub account is currently required to download the artifacts.
4. Extract the contents of the downloaded .zip (`warzone2100_ubuntu<version>_amd64.deb`) to your Desktop.
5. Execute the following commands in Terminal:
Expand Down Expand Up @@ -334,18 +334,6 @@ Do **not** use GitHub's "Download Zip" option, as it **does not contain submodul
```shell
sudo ./get-dependencies_linux.sh ubuntu build-dependencies
```
* Manually (Ubuntu 18.04)+:
```shell
sudo apt-get -u update
sudo apt-get -y install git gcc g++ clang cmake libc-dev dpkg-dev ninja-build zip unzip pkg-config gettext asciidoctor
sudo apt-get -y install libpng-dev libsdl2-dev libopenal-dev libphysfs-dev libvorbis-dev libtheora-dev libxrandr-dev libfribidi-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev libfontconfig1-dev libcurl4-gnutls-dev gnutls-dev libsodium-dev libsqlite3-dev
```
* Manually (Fedora):
```shell
sudo dnf -y update && dnf clean all
sudo dnf -y install git gcc gcc-c++ cmake ninja-build p7zip gettext rubygem-asciidoctor
sudo dnf -y install libpng-devel SDL2-devel openal-soft-devel physfs-devel libogg-devel libvorbis-devel libtheora-devel freetype-devel fribidi harfbuzz-devel libcurl-devel openssl-devel libsodium-devel sqlite-devel
```
* **Building from the command-line:**
1. Starting from the _parent_ directory of the warzone2100 source code (which is assumed to be in a folder named `warzone2100`), create a **sibling** build directory:
```shell
Expand All @@ -369,10 +357,10 @@ Do **not** use GitHub's "Download Zip" option, as it **does not contain submodul
### Windows using MSVC

* Prerequisites
* **Visual Studio 2019** (Visual Studio 2015-2017 may work, but 2019 is strongly encouraged)
* **Visual Studio 2022** (Visual Studio 2017-2019 may work, but 2022+ is strongly encouraged)
- If you do not already have Visual Studio installed, you can download the free **Visual Studio Community** from: https://developer.microsoft.com/en-us/windows/downloads
- IMPORTANT: You need the fully-featured Visual Studio IDE. “Visual Studio Code” does not include the necessary support for building C++ Windows apps.
* **CMake 3.10+** (https://cmake.org/)
* **CMake 3.20+** (https://cmake.org/)
* **Git** (if not building from a release source archive)
* **7-Zip** (https://www.7-zip.org)
* **Vulkan SDK 1.2.148.1+** (https://vulkan.lunarg.com/sdk/home)
Expand All @@ -383,14 +371,14 @@ Do **not** use GitHub's "Download Zip" option, as it **does not contain submodul
* **Building from the command-line:**
* Change directory to the warzone2100 repo directory
* Configure
* Visual Studio 2022: `cmake -H. -DCMAKE_TOOLCHAIN_FILE=vcpkg\scripts\buildsystems\vcpkg.cmake -Bbuild -G "Visual Studio 17 2022"`
* Visual Studio 2019: `cmake -H. -DCMAKE_TOOLCHAIN_FILE=vcpkg\scripts\buildsystems\vcpkg.cmake -Bbuild -G "Visual Studio 16 2019"`
* Visual Studio 2017: `cmake -H. -DCMAKE_TOOLCHAIN_FILE=vcpkg\scripts\buildsystems\vcpkg.cmake -Bbuild -G "Visual Studio 15 2017"`
* Visual Studio 2015: `cmake -H. -DCMAKE_TOOLCHAIN_FILE=vcpkg\scripts\buildsystems\vcpkg.cmake -Bbuild -G "Visual Studio 14 2015"`
* Build
* Release: `cmake --build build --config Release`
* Debug: `cmake --build build --config Debug`
* **Building using Visual Studio 2019:**
1. Open Visual Studio 2019
* **Building using Visual Studio:**
1. Open Visual Studio
2. Open the warzone2100 folder using **File** > **Open** > **Folder...**
- Allow Visual Studio some time to load the project and retrieve information from CMake.
3. Create a VS CMake settings JSON file using **CMake** > **Change CMake settings**. You can also reach this dialog by clicking "Manage Configurations" in the configuration dropdown in the toolbar. Make sure the CMake components in Visual Studio are installed (by running the Visual Studio Installer).
Expand Down
6 changes: 2 additions & 4 deletions doc/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Wait for all CI builds to complete, and verify they have completed successfully.
> To find the latest status, click on each image, or **view the Checks / Status for the commit on GitHub**.

[![Ubuntu](https://github.com/Warzone2100/warzone2100/workflows/Ubuntu/badge.svg?branch=master&event=push)](https://github.com/Warzone2100/warzone2100/actions?query=workflow%3AUbuntu+branch%3Amaster+event%3Apush)
[![Fedora](https://github.com/Warzone2100/warzone2100/workflows/Fedora/badge.svg?branch=master&event=push)](https://github.com/Warzone2100/warzone2100/actions?query=workflow%3AFedora+branch%3Amaster+event%3Apush)
[![Snapcraft](https://github.com/Warzone2100/warzone2100/workflows/Snapcraft/badge.svg?branch=master&event=push)](https://github.com/Warzone2100/warzone2100/actions?query=workflow%3ASnapcraft+branch%3Amaster+event%3Apush)
[![Flatpak](https://github.com/Warzone2100/warzone2100/workflows/Flatpak/badge.svg?branch=master&event=push)](https://github.com/Warzone2100/warzone2100/actions?query=workflow%3AFlatpak+branch%3Amaster+event%3Apush)
[![Windows](https://github.com/Warzone2100/warzone2100/workflows/Windows/badge.svg?branch=master&event=push)](https://github.com/Warzone2100/warzone2100/actions?query=workflow%3AWindows+branch%3Amaster+event%3Apush)
[![macOS](https://github.com/Warzone2100/warzone2100/workflows/macOS/badge.svg?branch=master&event=push)](https://github.com/Warzone2100/warzone2100/actions?query=workflow%3AmacOS+branch%3Amaster+event%3Apush)
[![Drone Cloud CI ARM64 Build Status](https://img.shields.io/drone/build/Warzone2100/warzone2100/master?label=ARM64%20Linux)](https://cloud.drone.io/Warzone2100/warzone2100)

Can be flakey:
- FreeBSD builds: [![FreeBSD Build Status](https://api.cirrus-ci.com/github/Warzone2100/warzone2100.svg?branch=master)](https://cirrus-ci.com/github/Warzone2100/warzone2100)
Expand Down Expand Up @@ -218,5 +218,3 @@ And, I am sure that people will spread the word about this new release at the fo
* [Reddit](https://www.reddit.com/r/warzone2100)
* [ModDb](https://www.moddb.com/games/warzone-2100)
* [Softonic](https://warzone-2100.en.softonic.com/)
* [Gamershell](http://www.gamershell.com/news)
* [Gamedev](http://www.gamedev.net/community/forums/forum.asp?forum_id=6)
47 changes: 47 additions & 0 deletions lib/ivis_opengl/3rdparty/vk_mem_alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# pragma clang diagnostic ignored "-Wmissing-field-initializers"
# pragma clang diagnostic ignored "-Wunused-private-field"
# pragma clang diagnostic ignored "-Wcast-align"
# pragma clang diagnostic ignored "-Wunused-function"
# if defined(__APPLE__)
# pragma clang diagnostic ignored "-Wnullability-completeness" // Warning triggered on newer Xcode
# endif
Expand All @@ -45,17 +46,63 @@
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
# pragma GCC diagnostic ignored "-Wmissing-noreturn"
# pragma GCC diagnostic ignored "-Wcast-align"
# pragma GCC diagnostic ignored "-Wunused-function"
#elif defined(_MSC_VER)
# pragma warning( push )
# pragma warning( disable : 4189 ) // warning C4189: 'identifier' : local variable is initialized but not referenced
# pragma warning( disable : 4324 ) // warning C4324: 'struct_name' : structure was padded due to alignment specifier
# pragma warning( disable : 4127 ) // warning C4127: conditional expression is constant
# pragma warning( disable : 4505 ) // warning C4505: unreferenced function with internal linkage has been removed
#endif

#define VMA_IMPLEMENTATION
#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
#define VMA_ASSERT(expr) ASSERT(expr, "VMA_ASSERT failed")
#include <cstdio>

// The VMA_NULLABLE macro is defined to be _Nullable when compiling with Clang.
// see: https://clang.llvm.org/docs/AttributeReference.html#nullable
#ifndef VMA_NULLABLE
#ifdef __clang__
#define VMA_NULLABLE _Nullable
#else
#define VMA_NULLABLE
#endif
#endif

// WZ Patch for C++14 compilation
#if (__cplusplus >= 201402L && __cplusplus < 201703L)
# if defined(__ANDROID_API__) && (__ANDROID_API__ < 16)
// do not do anything - is handled by vk_mem_alloc
# elif defined(__APPLE__) || defined(__ANDROID__)
// do not do anything - is handled by vk_mem_alloc
# elif defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__)
// On C++14, implement for Linux + BSDs (until we can require C++17)
// Reference: https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/332
#include <cstdlib>
static void* wz_vma_aligned_alloc(size_t alignment, size_t size)
{
// alignment must be >= sizeof(void*)
if(alignment < sizeof(void*))
{
alignment = sizeof(void*);
}

void *pointer;
if(posix_memalign(&pointer, alignment, size) == 0)
return pointer;
return nullptr;
}
static void wz_vma_aligned_free(void* VMA_NULLABLE ptr)
{
free(ptr);
}
# define VMA_SYSTEM_ALIGNED_MALLOC(size, alignment) wz_vma_aligned_alloc((alignment), (size))
# define VMA_SYSTEM_ALIGNED_FREE(ptr) wz_vma_aligned_free(ptr)
# endif
#endif

#include "vk_mem_alloc.h"

#if defined(__clang__)
Expand Down
Loading
Loading