@@ -13,20 +13,6 @@ if(MSYS)
1313 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -DMSYS_PROCESS_USE_SH" )
1414endif ()
1515
16- string (REPLACE libclang liblldb LIBLLDB_LIBRARIES "${LIBCLANG_LIBRARIES} " )
17- if (EXISTS "${LIBLLDB_LIBRARIES} " )
18- set (LIBLLDB_FOUND TRUE )
19- elseif (EXISTS "${LIBLLDB_LIBRARIES} .1" )
20- set (LIBLLDB_LIBRARIES "${LIBLLDB_LIBRARIES} .1" )
21- set (LIBLLDB_FOUND TRUE )
22- endif ()
23- if (LIBLLDB_FOUND)
24- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -DJUCI_ENABLE_DEBUG" )
25- else ()
26- set (LIBLLDB_LIBRARIES "" )
27- message ("liblldb not found. Building juCi++ without debugging support" )
28- endif ()
29-
3016set (global_includes
3117 ${Boost_INCLUDE_DIRS}
3218 ${GTKMM_INCLUDE_DIRS}
@@ -38,54 +24,40 @@ set(global_includes
3824)
3925
4026set (global_libraries
41- ${LIBCLANG_LIBRARIES}
4227 ${GTKMM_LIBRARIES}
4328 ${GTKSVMM_LIBRARIES}
4429 ${Boost_LIBRARIES}
45- ${ASPELL_LIBRARIES }
30+ ${LIBCLANG_LIBRARIES }
4631 ${LIBLLDB_LIBRARIES}
32+ ${ASPELL_LIBRARIES}
4733)
4834
4935set (project_files
50- cmake.cc
51- cmake.h
5236 config.cc
53- config.h
5437 dialogs.cc
55- dialogs.h
5638 directories.cc
57- directories.h
58- dispatcher.cc
59- dispatcher.h
6039 entrybox.cc
61- entrybox.h
62- files.h
63- filesystem.cc
64- filesystem.h
65- info.h
6640 info.cc
6741 juci.cc
68- juci.h
6942 menu.cc
70- menu.h
7143 notebook.cc
72- notebook.h
7344 project.cc
74- project.h
75- project_build.h
76- project_build.cc
7745 selectiondialog.cc
78- selectiondialog.h
79- source.cc
80- source.h
81- source_clang.cc
82- source_clang.h
8346 terminal.cc
84- terminal.h
8547 tooltips.cc
86- tooltips.h
8748 window.cc
88- window.h
49+
50+ ../tiny-process-library/process.cpp
51+ )
52+
53+ #Files used both in ../src and ../tests
54+ set (project_shared_files
55+ cmake.cc
56+ dispatcher.cc
57+ filesystem.cc
58+ project_build.cc
59+ source.cc
60+ source_clang.cc
8961
9062 ../libclangmm/src/CodeCompleteResults.cc
9163 ../libclangmm/src/CompilationDatabase.cc
@@ -101,11 +73,10 @@ set(project_files
10173 ../libclangmm/src/Tokens.cc
10274 ../libclangmm/src/TranslationUnit.cc
10375 ../libclangmm/src/Utility.cc
104-
105- ../tiny-process-library/process.cpp)
76+ )
10677
10778if (LIBLLDB_FOUND)
108- list (APPEND project_files debug_clang.h debug_clang.cc)
79+ list (APPEND project_shared_files debug_clang.cc)
10980endif ()
11081
11182if (MSYS )
@@ -116,11 +87,13 @@ endif()
11687
11788include_directories (${global_includes} )
11889
90+ add_library (project_shared ${project_shared_files} )
91+
11992if (("${CMAKE_CXX_COMPILER_ID } " STREQUAL "Clang" ) AND (NOT $ENV{distribution} STREQUAL "" ))
12093 add_library (${project_name } OBJECT ${project_files} )
12194else ()
12295 add_executable (${project_name } ${project_files} )
123- target_link_libraries (${project_name } ${global_libraries} )
96+ target_link_libraries (${project_name } ${global_libraries} project_shared )
12497 install (TARGETS ${project_name }
12598 RUNTIME DESTINATION bin
12699 )
0 commit comments