From d361ea15fb72bfba21f6d3aac9491467a13ebb21 Mon Sep 17 00:00:00 2001 From: Dean Moldovan Date: Tue, 14 Feb 2017 20:11:25 +0100 Subject: [PATCH] Don't strip debug symbols in debug mode (#669) --- tools/pybind11Tools.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/pybind11Tools.cmake b/tools/pybind11Tools.cmake index e0985452..3fbffeef 100644 --- a/tools/pybind11Tools.cmake +++ b/tools/pybind11Tools.cmake @@ -173,8 +173,8 @@ function(pybind11_add_module target_name) _pybind11_add_lto_flags(${target_name} ${ARG_THIN_LTO}) - # Set the default symbol visibility to hidden (very important to obtain small binaries) - if (NOT MSVC) + if (NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug) + # Set the default symbol visibility to hidden (very important to obtain small binaries) target_compile_options(${target_name} PRIVATE "-fvisibility=hidden") # Strip unnecessary sections of the binary on Linux/Mac OS