diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d7bbe9..2ec17c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index 9a6773e..23ad98a 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -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/ diff --git a/engine/src/log.c b/engine/src/log.c index d0b260d..8e9fab4 100644 --- a/engine/src/log.c +++ b/engine/src/log.c @@ -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|");