From f6b6dfd6729777dc6e06de9c365e3c14cd399e63 Mon Sep 17 00:00:00 2001 From: Nikita Ushakov Date: Tue, 24 Dec 2024 15:49:48 +0000 Subject: [PATCH] Allow to compile as static library without cpp files --- cmake/sourcesdk.cmake | 7 +++++++ public/main.cpp | 0 public/tier0/platform.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 public/main.cpp diff --git a/cmake/sourcesdk.cmake b/cmake/sourcesdk.cmake index 1b284cd48..fbbdcca9a 100644 --- a/cmake/sourcesdk.cmake +++ b/cmake/sourcesdk.cmake @@ -72,6 +72,13 @@ if(SOURCESDK_MALLOC_OVERRIDE) # memoverride.cpp is not usable on CMake Windows, because CMake default link libraries always link ucrt.lib ${SOURCESDK_DIR}/public/tier0/memoverride.cpp ) +else() + set(SOURCESDK_SOURCE_FILES + ${SOURCESDK_SOURCE_FILES} + + # dummy cpp file + ${SOURCESDK_DIR}/public/main.cpp + ) endif() set(SOURCESDK_LIB_DIR "${SOURCESDK_DIR}/lib") diff --git a/public/main.cpp b/public/main.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/public/tier0/platform.h b/public/tier0/platform.h index 2941755ac..255fc0059 100644 --- a/public/tier0/platform.h +++ b/public/tier0/platform.h @@ -1127,7 +1127,9 @@ typedef void * HINSTANCE; //----------------------------------------------------------------------------- // Used to break into the debugger //----------------------------------------------------------------------------- -#ifdef COMPILER_MSVC64 +#ifdef COMPILER_MSVC + #define DebuggerBreak() __debugbreak() +#elif COMPILER_MSVC64 #define DebuggerBreak() __debugbreak() #elif COMPILER_MSVC32 #define DebuggerBreak() __asm { int 3 }