From c4bc45cff4951435502144ee5cd630dff4ea113a Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 29 Jan 2019 09:57:17 +0100 Subject: [PATCH] Add DEBUG and _DEBUG symbols on OSX & Linux in a way the Visual Studio does that. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4e599f36..4e42e24e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,6 +85,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) +if(NOT WIN32) + # Add DEBUG flags for the debug builds in a way the Visual Studio adds these flags. + add_compile_options("$<$:-DDEBUG>") + add_compile_options("$<$:-D_DEBUG>") +endif() + # To be able to link libslic3r with the Perl XS module. # Once we get rid of Perl and libslic3r is linked statically, we can get rid of -fPIC set(CMAKE_POSITION_INDEPENDENT_CODE ON)