diff --git a/CMakeLists.txt b/CMakeLists.txt index c32dc26..5822bad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -247,6 +247,11 @@ if(WIN32) _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS ) +else() + target_compile_definitions(${EXECUTABLE_NAME} PRIVATE + $<$:_DEBUG> + $<$:_DEBUG> + ) endif() if(WIN32) diff --git a/src/debug.cc b/src/debug.cc index b448310..810a487 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -142,7 +142,7 @@ int debugPrint(const char* format, ...) #ifdef _WIN32 OutputDebugStringA(string); #else - printf(string); + printf("%s", string); #endif #endif rc = -1;