File tree Expand file tree Collapse file tree 3 files changed +20
-15
lines changed Expand file tree Collapse file tree 3 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -124,10 +124,17 @@ if (LLDB_ENABLE_LUA)
124124 finish_swig_lua("lldb-lua" "${lldb_lua_bindings_dir} " "${lldb_lua_target_dir} " )
125125endif ()
126126
127+ set (LLDB_INCLUDE_UNITTESTS ON )
128+ if (NOT TARGET llvm_gtest)
129+ set (LLDB_INCLUDE_UNITTESTS OFF )
130+ endif ()
131+
127132option (LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_TESTS} )
128133if (LLDB_INCLUDE_TESTS)
129134 add_subdirectory (test )
130- add_subdirectory (unittests)
135+ if (LLDB_INCLUDE_UNITTESTS)
136+ add_subdirectory (unittests)
137+ endif ()
131138 add_subdirectory (utils)
132139endif ()
133140
Original file line number Diff line number Diff line change @@ -97,6 +97,18 @@ include(LLVMDistributionSupport)
9797set (PACKAGE_VERSION "${LLVM_PACKAGE_VERSION} " )
9898set (LLVM_INCLUDE_TESTS ON CACHE INTERNAL "" )
9999
100+ # Build the gtest library needed for unittests, if we have LLVM sources
101+ # handy.
102+ if (EXISTS ${LLVM_MAIN_SRC_DIR} /utils/unittest AND NOT TARGET llvm_gtest)
103+ add_subdirectory (${LLVM_MAIN_SRC_DIR} /utils/unittest utils/unittest)
104+ endif ()
105+ # LLVMTestingSupport library is needed for Process/gdb-remote.
106+ if (EXISTS ${LLVM_MAIN_SRC_DIR} /lib/Testing/Support
107+ AND NOT TARGET LLVMTestingSupport)
108+ add_subdirectory (${LLVM_MAIN_SRC_DIR} /lib/Testing/Support
109+ lib/Testing/Support)
110+ endif ()
111+
100112option (LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON )
101113if (LLVM_USE_FOLDERS)
102114 set_property (GLOBAL PROPERTY USE_FOLDERS ON )
Original file line number Diff line number Diff line change @@ -17,20 +17,6 @@ else ()
1717 list (APPEND LLVM_COMPILE_FLAGS -include ${LLDB_GTEST_COMMON_INCLUDE} )
1818endif ()
1919
20- if (LLDB_BUILT_STANDALONE)
21- # Build the gtest library needed for unittests, if we have LLVM sources
22- # handy.
23- if (EXISTS ${LLVM_MAIN_SRC_DIR} /utils/unittest AND NOT TARGET llvm_gtest)
24- add_subdirectory (${LLVM_MAIN_SRC_DIR} /utils/unittest utils/unittest)
25- endif ()
26- # LLVMTestingSupport library is needed for Process/gdb-remote.
27- if (EXISTS ${LLVM_MAIN_SRC_DIR} /lib/Testing/Support
28- AND NOT TARGET LLVMTestingSupport)
29- add_subdirectory (${LLVM_MAIN_SRC_DIR} /lib/Testing/Support
30- lib/Testing/Support)
31- endif ()
32- endif ()
33-
3420function (add_lldb_unittest test_name)
3521 cmake_parse_arguments (ARG
3622 ""
You can’t perform that action at this time.
0 commit comments