Browse Source

Will now compile without debug support if liblldb is not found

merge-requests/365/head
eidheim 10 years ago
parent
commit
4cf9a4011b
  1. 20
      src/CMakeLists.txt
  2. 5
      src/source_clang.cc
  3. 4
      src/window.cc

20
src/CMakeLists.txt

@ -28,8 +28,18 @@ endif()
INCLUDE(FindPkgConfig) INCLUDE(FindPkgConfig)
find_package(LibClang REQUIRED) 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(PythonLibs 2.7)
#find_package(Boost 1.55 COMPONENTS python thread log system filesystem REQUIRED) #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) ../tiny-process-library/process.cpp)
if(LIBLLDB_FOUND)
list(APPEND source_files debug.h debug.cc)
endif()
if(MSYS) 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 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) list(APPEND source_files ../tiny-process-library/process_win.cpp)
@ -139,7 +153,7 @@ target_link_libraries(${project_name}
${GTKSVMM_LIBRARIES} ${GTKSVMM_LIBRARIES}
${Boost_LIBRARIES} ${Boost_LIBRARIES}
${ASPELL_LIBRARIES} ${ASPELL_LIBRARIES}
${LLDB_LIBRARIES} ${LIBLLDB_LIBRARIES}
#${PYTHON_LIBRARIES} #${PYTHON_LIBRARIES}
) )

5
src/source_clang.cc

@ -2,7 +2,9 @@
#include "config.h" #include "config.h"
#include "terminal.h" #include "terminal.h"
#include "cmake.h" #include "cmake.h"
#ifdef JUCI_ENABLE_DEBUG
#include "debug.h" #include "debug.h"
#endif
namespace sigc { namespace sigc {
#ifndef SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE #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(); auto brief_comment=token.get_cursor().get_brief_comments();
if(brief_comment!="") if(brief_comment!="")
tooltip_buffer->insert_with_tag(tooltip_buffer->get_insert()->get_iter(), "\n\n"+brief_comment, "def:note"); 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 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); auto debug_value=Debug::get().get_value(token.get_spelling(), location.get_path(), location.get_offset().line);
if(!debug_value.empty()) { if(!debug_value.empty()) {
@ -421,6 +425,7 @@ void Source::ClangViewParse::show_type_tooltips(const Gdk::Rectangle &rectangle)
if(pos!=std::string::npos) 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"); tooltip_buffer->insert_with_tag(tooltip_buffer->get_insert()->get_iter(), "\n\nValue: "+debug_value.substr(pos+3), "def:note");
} }
#endif
return tooltip_buffer; return tooltip_buffer;
}; };

4
src/window.cc

@ -6,7 +6,9 @@
//#include "api.h" //#include "api.h"
#include "dialogs.h" #include "dialogs.h"
#include "filesystem.h" #include "filesystem.h"
#ifdef JUCI_ENABLE_DEBUG
#include "debug.h" #include "debug.h"
#endif
namespace sigc { namespace sigc {
#ifndef SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE #ifndef SIGC_FUNCTORS_DEDUCE_RESULT_TYPE_WITH_DECLTYPE
@ -648,6 +650,7 @@ void Window::set_menu_actions() {
Terminal::get().kill_last_async_process(true); Terminal::get().kill_last_async_process(true);
}); });
#ifdef JUCI_ENABLE_DEBUG
menu.add_action("debug_start_continue", [this](){ menu.add_action("debug_start_continue", [this](){
if(debugging) { if(debugging) {
//Continue //Continue
@ -797,6 +800,7 @@ void Window::set_menu_actions() {
} }
} }
}); });
#endif
menu.add_action("next_tab", [this]() { menu.add_action("next_tab", [this]() {
if(notebook.get_current_page()!=-1) { if(notebook.get_current_page()!=-1) {

Loading…
Cancel
Save