Skip to content

Commit

Permalink
Allow to compile as static library without cpp files
Browse files Browse the repository at this point in the history
  • Loading branch information
qubka committed Dec 24, 2024
1 parent bb4132f commit f6b6dfd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cmake/sourcesdk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Empty file added public/main.cpp
Empty file.
4 changes: 3 additions & 1 deletion public/tier0/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit f6b6dfd

Please sign in to comment.