diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 25ea8dd..4697d60 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,8 +28,18 @@ endif() INCLUDE(FindPkgConfig) find_package(LibClang REQUIRED) -string(REPLACE libclang liblldb LLDB_LIBRARIES "${LIBCLANG_LIBRARIES}") - +string(REPLACE libclang liblldb LIBLLDB_LIBRARIES "${LIBCLANG_LIBRARIES}") +if(EXISTS "${LIBLLDB_LIBRARIES}") + set(LIBLLDB_FOUND TRUE) +elseif(EXISTS "${LIBLLDB_LIBRARIES}.1") + set(LIBLLDB_LIBRARIES "${LIBLLDB_LIBRARIES}.1") + set(LIBLLDB_FOUND TRUE) +endif() +if(LIBLLDB_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DJUCI_ENABLE_DEBUG") +else() + set(LIBLLDB_LIBRARIES "") +endif() #find_package(PythonLibs 2.7) #find_package(Boost 1.55 COMPONENTS python thread log system filesystem REQUIRED) @@ -93,6 +103,10 @@ set(source_files juci.h ../tiny-process-library/process.cpp) +if(LIBLLDB_FOUND) + list(APPEND source_files debug.h debug.cc) +endif() + if(MSYS) list(APPEND source_files dialogs_unix.cc) #dialogs_win.cc does not work any more because of missing SHCreateItemFromParsingName list(APPEND source_files ../tiny-process-library/process_win.cpp) @@ -139,7 +153,7 @@ target_link_libraries(${project_name} ${GTKSVMM_LIBRARIES} ${Boost_LIBRARIES} ${ASPELL_LIBRARIES} - ${LLDB_LIBRARIES} + ${LIBLLDB_LIBRARIES} #${PYTHON_LIBRARIES} ) diff --git a/src/source_clang.cc b/src/source_clang.cc index 6ddf380..4f9ea04 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -2,7 +2,9 @@ #include "config.h" #include "terminal.h" #include "cmake.h" +#ifdef JUCI_ENABLE_DEBUG #include "debug.h" +#endif namespace sigc { #ifndef SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE @@ -413,6 +415,8 @@ void Source::ClangViewParse::show_type_tooltips(const Gdk::Rectangle &rectangle) auto brief_comment=token.get_cursor().get_brief_comments(); if(brief_comment!="") tooltip_buffer->insert_with_tag(tooltip_buffer->get_insert()->get_iter(), "\n\n"+brief_comment, "def:note"); + +#ifdef JUCI_ENABLE_DEBUG auto location=token.get_cursor().get_referenced().get_source_location(); auto debug_value=Debug::get().get_value(token.get_spelling(), location.get_path(), location.get_offset().line); if(!debug_value.empty()) { @@ -421,6 +425,7 @@ void Source::ClangViewParse::show_type_tooltips(const Gdk::Rectangle &rectangle) if(pos!=std::string::npos) tooltip_buffer->insert_with_tag(tooltip_buffer->get_insert()->get_iter(), "\n\nValue: "+debug_value.substr(pos+3), "def:note"); } +#endif return tooltip_buffer; }; diff --git a/src/window.cc b/src/window.cc index 7bb9a49..34df94c 100644 --- a/src/window.cc +++ b/src/window.cc @@ -6,7 +6,9 @@ //#include "api.h" #include "dialogs.h" #include "filesystem.h" +#ifdef JUCI_ENABLE_DEBUG #include "debug.h" +#endif namespace sigc { #ifndef SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE @@ -648,6 +650,7 @@ void Window::set_menu_actions() { Terminal::get().kill_last_async_process(true); }); +#ifdef JUCI_ENABLE_DEBUG menu.add_action("debug_start_continue", [this](){ if(debugging) { //Continue @@ -797,6 +800,7 @@ void Window::set_menu_actions() { } } }); +#endif menu.add_action("next_tab", [this]() { if(notebook.get_current_page()!=-1) {