From 8c2b9c7aeca2bfe5fbd679939dc625925fc0fe85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0imek?= Date: Sun, 12 Jun 2022 10:44:22 +0200 Subject: [PATCH] Enable debug output on linux (#45) --- CMakeLists.txt | 5 +++++ src/debug.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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;