mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
build: 64-bit targets only
CMake refuses to configure when pointers aren't 8 bytes, and dCommonVars.h asserts it, so sent and stored sizes can't silently change width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,11 @@ if("${CMAKE_SOURCE_DIR}" MATCHES " ")
|
|||||||
message(FATAL_ERROR "The server cannot build in the path (" ${CMAKE_SOURCE_DIR} ") because it contains a space. Please move the server to a path without spaces.")
|
message(FATAL_ERROR "The server cannot build in the path (" ${CMAKE_SOURCE_DIR} ") because it contains a space. Please move the server to a path without spaces.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Only 64-bit builds are supported: sent and stored values assume 64-bit pointers and sizes
|
||||||
|
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
|
message(FATAL_ERROR "The server only builds for 64-bit targets (this configuration is ${CMAKE_SIZEOF_VOID_P}-byte pointers). Use a 64-bit compiler and generator, e.g. -A x64 with Visual Studio.")
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|||||||
@@ -326,6 +326,8 @@ CREATE DATABASE darkflame;
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Build the server
|
## Build the server
|
||||||
|
The server only builds for 64-bit targets; CMake refuses to configure a 32-bit build.
|
||||||
|
|
||||||
You can either run `build.sh` when in the root folder of the repository:
|
You can either run `build.sh` when in the root folder of the repository:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
|
|
||||||
#pragma warning (disable:4251) //Disables SQL warnings
|
#pragma warning (disable:4251) //Disables SQL warnings
|
||||||
|
|
||||||
|
static_assert(sizeof(void*) == 8, "The server only builds for 64-bit targets");
|
||||||
|
|
||||||
// These are the same define, but they mean two different things in different contexts
|
// These are the same define, but they mean two different things in different contexts
|
||||||
// so a different define to distinguish what calculation is happening will help clarity.
|
// so a different define to distinguish what calculation is happening will help clarity.
|
||||||
#define FRAMES_TO_MS(x) (1000 / (x))
|
#define FRAMES_TO_MS(x) (1000 / (x))
|
||||||
|
|||||||
Reference in New Issue
Block a user