Skip to content

Commit 8a084f6

Browse files
committed
Revert "Move googletest to the third-party directory"
This reverts commit 5905246. It looks like this patch breaks the build when compiler-rt is passed to LLVM_ENABLE_PROJECTS instead of LLVM_ENABLE_RUNTIMES.
1 parent 0b01aeb commit 8a084f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+18
-18
lines changed

clang/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ if(CLANG_BUILT_STANDALONE)
111111
set(LLVM_UTILS_PROVIDED ON)
112112
set(CLANG_TEST_DEPS FileCheck count not)
113113
endif()
114-
set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
114+
set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
115115
if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
116116
AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
117117
AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
118-
add_subdirectory(${UNITTEST_DIR} third-party/unittest)
118+
add_subdirectory(${UNITTEST_DIR} utils/unittest)
119119
endif()
120120
endif()
121121

@@ -526,7 +526,7 @@ endif()
526526

527527

528528
if( CLANG_INCLUDE_TESTS )
529-
if(EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
529+
if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
530530
add_subdirectory(unittests)
531531
list(APPEND CLANG_TEST_DEPS ClangUnitTests)
532532
list(APPEND CLANG_TEST_PARAMS

compiler-rt/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ elseif (SANITIZER_TEST_CXX_LIBNAME STREQUAL "libstdc++")
639639
endif()
640640

641641
# Unittests support.
642-
set(COMPILER_RT_GTEST_PATH ${LLVM_THIRD_PARTY_DIR}/unittest/googletest)
642+
set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest)
643643
set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/src/gtest-all.cc)
644644
set(COMPILER_RT_GTEST_CFLAGS
645645
-DGTEST_NO_LLVM_SUPPORT=1
@@ -649,7 +649,7 @@ set(COMPILER_RT_GTEST_CFLAGS
649649
)
650650

651651
# Mocking support.
652-
set(COMPILER_RT_GMOCK_PATH ${LLVM_THIRD_PATY_DIR}/unittest/googlemock)
652+
set(COMPILER_RT_GMOCK_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock)
653653
set(COMPILER_RT_GMOCK_SOURCE ${COMPILER_RT_GMOCK_PATH}/src/gmock-all.cc)
654654
set(COMPILER_RT_GMOCK_CFLAGS
655655
-DGTEST_NO_LLVM_SUPPORT=1

lld/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ if(LLD_BUILT_STANDALONE)
6868
set(LLVM_UTILS_PROVIDED ON)
6969
set(LLD_TEST_DEPS FileCheck not)
7070
endif()
71-
set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
71+
set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
7272
if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
7373
AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
7474
AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
75-
add_subdirectory(${UNITTEST_DIR} third-party/unittest)
75+
add_subdirectory(${UNITTEST_DIR} utils/unittest)
7676
endif()
7777
else()
7878
# Seek installed Lit.

lldb/cmake/modules/LLDBStandalone.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ include_directories(
100100
if(LLDB_INCLUDE_TESTS)
101101
# Build the gtest library needed for unittests, if we have LLVM sources
102102
# handy.
103-
if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest AND NOT TARGET llvm_gtest)
104-
add_subdirectory(${LLVM_THIRD_PARTY_DIR}}/utils/unittest third-party/unittest)
103+
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest AND NOT TARGET llvm_gtest)
104+
add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/unittest utils/unittest)
105105
endif()
106106
# LLVMTestingSupport library is needed for Process/gdb-remote.
107107
if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support

llvm/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} ) # --src-root
401401
set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include ) # --includedir
402402
set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ) # --prefix
403403

404+
set(LLVM_THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../third-party)
404405

405406
# Note: LLVM_CMAKE_DIR does not include generated files
406407
set(LLVM_CMAKE_DIR ${LLVM_MAIN_SRC_DIR}/cmake/modules)
@@ -1193,7 +1194,7 @@ if( LLVM_INCLUDE_UTILS )
11931194
add_subdirectory(utils/yaml-bench)
11941195
add_subdirectory(utils/split-file)
11951196
if( LLVM_INCLUDE_TESTS )
1196-
add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest ${CMAKE_CURRENT_BINARY_DIR}/third-party/unittest)
1197+
add_subdirectory(utils/unittest)
11971198
endif()
11981199
else()
11991200
if ( LLVM_INCLUDE_TESTS )

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,3 @@ if(LLVM_USE_RELATIVE_PATHS_IN_FILES)
12601260
append_if(SUPPORTS_FFILE_PREFIX_MAP "-ffile-prefix-map=${source_root}/=${LLVM_SOURCE_PREFIX}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
12611261
add_flag_if_supported("-no-canonical-prefixes" NO_CANONICAL_PREFIXES)
12621262
endif()
1263-
1264-
set(LLVM_THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../third-party CACHE STRING
1265-
"Directory containing third party software used by LLVM (e.g. googletest)")

mlir/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ if(MLIR_STANDALONE_BUILD)
2525

2626
include_directories(${LLVM_INCLUDE_DIRS})
2727

28-
set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
28+
set(LLVM_MAIN_SRC_DIR ${CMAKE_SOURCE_DIR}/../llvm CACHE PATH
29+
"Path to LLVM source tree")
30+
set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
2931
if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
30-
add_subdirectory(${UNITTEST_DIR} third-party/unittest)
32+
add_subdirectory(${UNITTEST_DIR} utils/unittest)
3133
endif()
3234

3335
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
@@ -176,7 +178,7 @@ add_subdirectory(lib/CAPI)
176178
if (MLIR_INCLUDE_TESTS)
177179
add_definitions(-DMLIR_INCLUDE_TESTS)
178180
add_custom_target(MLIRUnitTests)
179-
if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
181+
if (EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
180182
add_subdirectory(unittests)
181183
else()
182184
message(WARNING "gtest not found, unittests will not be available")

polly/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ if(POLLY_STANDALONE_BUILD)
2828

2929
# Enable unit tests if available.
3030
set(POLLY_GTEST_AVAIL 0)
31-
set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
31+
set(UNITTEST_DIR ${LLVM_SOURCE_ROOT}/utils/unittest)
3232
if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
3333
if (NOT TARGET gtest)
34-
add_subdirectory(${UNITTEST_DIR} third-party/unittest)
34+
add_subdirectory(${UNITTEST_DIR} utils/unittest)
3535
endif()
3636
set(POLLY_GTEST_AVAIL 1)
3737
endif()

0 commit comments

Comments
 (0)