[PATCH] D121233: [pseudo] Move pseudoparser from clang to clang-tools-extra

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 4 05:58:32 PDT 2022


sammccall added a comment.

In D121233#3425793 <https://reviews.llvm.org/D121233#3425793>, @bjope wrote:

> Have had problems with failing stage 2 builds since this patch:
>
>   FAILED: tools/clang/tools/extra/pseudo/unittests/CMakeFiles/ClangPseudoTests.dir/DirectiveMapTest.cpp.o 
>   /repo//install/stage2/bin/clang++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/extra/pseudo/unittests -I/repo//llvm-project/clang-tools-extra/pseudo/unittests -I/repo//llvm-project/clang/include -Itools/clang/include -Iinclude -I/repo//llvm-project/llvm/include -I/repo//llvm-project/clang-tools-extra/pseudo/include -Itools/clang/tools/extra/pseudo/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -flto=thin -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG    -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT tools/clang/tools/extra/pseudo/unittests/CMakeFiles/ClangPseudoTests.dir/DirectiveMapTest.cpp.o -MF tools/clang/tools/extra/pseudo/unittests/CMakeFiles/ClangPseudoTests.dir/DirectiveMapTest.cpp.o.d -o tools/clang/tools/extra/pseudo/unittests/CMakeFiles/ClangPseudoTests.dir/DirectiveMapTest.cpp.o -c /repo//llvm-project/clang-tools-extra/pseudo/unittests/DirectiveMapTest.cpp
>   /repo//llvm-project/clang-tools-extra/pseudo/unittests/DirectiveMapTest.cpp:16:10: fatal error: 'gmock/gmock.h' file not found
>   #include "gmock/gmock.h"
>            ^~~~~~~~~~~~~~~
>   1 error generated.
>
> Is there some dependency to googletest missing somewhere?
>
> (Unless someone not just knows about these things, then I guess I need to debug our build setup a bit more to give more details about it.)

The `-I` is supposed to be added by t

In D121233#3425793 <https://reviews.llvm.org/D121233#3425793>, @bjope wrote:

> Have had problems with failing stage 2 builds since this patch:
>
>   FAILED: tools/clang/tools/extra/pseudo/unittests/CMakeFiles/ClangPseudoTests.dir/DirectiveMapTest.cpp.o 
>   /repo//install/stage2/bin/clang++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/extra/pseudo/unittests -I/repo//llvm-project/clang-tools-extra/pseudo/unittests -I/repo//llvm-project/clang/include -Itools/clang/include -Iinclude -I/repo//llvm-project/llvm/include -I/repo//llvm-project/clang-tools-extra/pseudo/include -Itools/clang/tools/extra/pseudo/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -flto=thin -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG    -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT tools/clang/tools/extra/pseudo/unittests/CMakeFiles/ClangPseudoTests.dir/DirectiveMapTest.cpp.o -MF tools/clang/tools/extra/pseudo/unittests/CMakeFiles/ClangPseudoTests.dir/DirectiveMapTest.cpp.o.d -o tools/clang/tools/extra/pseudo/unittests/CMakeFiles/ClangPseudoTests.dir/DirectiveMapTest.cpp.o -c /repo//llvm-project/clang-tools-extra/pseudo/unittests/DirectiveMapTest.cpp
>   /repo//llvm-project/clang-tools-extra/pseudo/unittests/DirectiveMapTest.cpp:16:10: fatal error: 'gmock/gmock.h' file not found
>   #include "gmock/gmock.h"
>            ^~~~~~~~~~~~~~~
>   1 error generated.
>
> Is there some dependency to googletest missing somewhere?
>
> (Unless someone not just knows about these things, then I guess I need to debug our build setup a bit more to give more details about it.)

The way this is meant to work is:

- pseudo/unittests/CMakeLists.txt calls `add_unittest`
- add_unittest (in AddLLVM.cmake) adds a dependency on `llvm_gtest`
- `llvm_gtest` is defined in llvm/utils/unittest/CMakeLists.txt, and specifies `target_include_directories(llvm_gtest PUBLIC ...)` to add the directories

As far as I can tell this is how other things in clang and clang-tools-extra work

Maybe your configuration is just not building unittests and we're not respecting that setting? I'll try making that conditional...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121233/new/

https://reviews.llvm.org/D121233



More information about the cfe-commits mailing list