Skip to content

Commit c4b76ab

Browse files
committed
cmake: generate printable DAEMON_SYSTEM_STRING
1 parent 92bf9fc commit c4b76ab

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

cmake/DaemonPlatform/System.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,8 @@ endif()
109109
# > if (DAEMON_SYSTEM_Windows)
110110
set("DAEMON_HOST_SYSTEM_${DAEMON_HOST_SYSTEM_NAME}" ON)
111111
set("DAEMON_SYSTEM_${DAEMON_SYSTEM_NAME}" ON)
112+
113+
if (DAEMON_SOURCE_GENERATOR)
114+
# Add printable string to the executable.
115+
daemon_add_buildinfo("char*" "DAEMON_SYSTEM_STRING" "\"${DAEMON_SYSTEM_NAME}\"")
116+
endif()

src/common/Platform.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333

3434
// Platform-specific configuration
3535
#if defined(_WIN32)
36-
#define PLATFORM_STRING "Windows"
3736
#elif defined(__APPLE__)
38-
#define PLATFORM_STRING "macOS"
3937
#elif defined(__linux__)
40-
#define PLATFORM_STRING "Linux"
4138
#elif defined(__FreeBSD__)
42-
#define PLATFORM_STRING "FreeBSD"
4339
#elif defined(__native_client__)
44-
#define PLATFORM_STRING "NaCl"
4540
#else
4641
#error "Platform not supported"
4742
#endif
4843

44+
// TODO: Remove once the game code is ported to DAEMON_SYSTEM_STRING.
45+
#define PLATFORM_STRING DAEMON_SYSTEM_STRING
46+
4947
#if defined(__native_client__)
5048
#elif defined(_WIN32)
5149
#define DLL_EXT ".dll"

src/engine/framework/System.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ static void Init(int argc, char** argv)
844844
#endif
845845

846846
// Print a banner and a copy of the command-line arguments
847-
Log::Notice("%s %s %s (%s) %s", Q3_VERSION, PLATFORM_STRING, DAEMON_ARCH_STRING, DAEMON_CXX_COMPILER_STRING, __DATE__);
847+
Log::Notice("%s %s %s (%s) %s", Q3_VERSION, DAEMON_SYSTEM_STRING, DAEMON_ARCH_STRING, DAEMON_CXX_COMPILER_STRING, __DATE__);
848848

849849
std::string argsString = "cmdline:";
850850
for (int i = 1; i < argc; i++) {

0 commit comments

Comments
 (0)