properly do debug

This commit is contained in:
Nishi 2026-01-12 11:53:23 +09:00
commit c45cf566c0
Signed by: nishi
GPG key ID: 27EF69B208EB9343
3 changed files with 12 additions and 0 deletions

View file

@ -1,6 +1,10 @@
cmake_minimum_required(VERSION 3.11)
project(assaultfish)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
include(GNUInstallDirs)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

View file

@ -25,6 +25,10 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
target_link_libraries(GearSrc PRIVATE m)
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
target_compile_definitions(GearSrc PRIVATE DEBUG)
endif()
install_target(GearSrc)
install(
DIRECTORY include/

View file

@ -4,6 +4,10 @@ void GSLog(int level, const char* fmt, ...) {
va_list va;
FILE* out = stdout;
#ifndef DEBUG
if(level == GSLogDebug) return;
#endif
#ifdef _WIN32
fprintf(out, "[GearSrc|");