properly do debug
This commit is contained in:
parent
32919ca13d
commit
c45cf566c0
3 changed files with 12 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
|
|
|||
|
|
@ -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|");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue