[Openmp-commits] [openmp] [OpenMP][omptest] Improve CMake and address review comments (PR #159416)
David Spickett via Openmp-commits
openmp-commits at lists.llvm.org
Wed Oct 1 06:06:08 PDT 2025
DavidSpickett wrote:
Our flang built with libcxx bot has been broken since https://github.com/llvm/llvm-project/pull/154786 landed, that's our fault for leaving it so long.
So I've just got to trying this in case it helped, and I get:
```
[9/11] Building CXX object openmp/tools/omptest/CMakeFiles/omptest.dir/src/OmptTester.cpp.o
FAILED: openmp/tools/omptest/CMakeFiles/omptest.dir/src/OmptTester.cpp.o
/home/tcwg-buildbot/build-llvm-flang/./bin/clang++ --target=aarch64-unknown-linux-gnu -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Domptest_EXPORTS -I/home/tcwg-buildbot/build-llvm-flang/runtimes/runtimes-bins/openmp/runtime/src -I/home/tcwg-buildbot/llvm-project/llvm/include -I/home/tcwg-buildbot/build-llvm-flang/include -I/home/tcwg-buildbot/llvm-project/openmp/tools/omptest/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -fcolor-diagnostics -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -fno-semantic-interposition -fdata-sections -O3 -DNDEBUG -std=c++17 -fPIC -fvisibility=default -UNDEBUG -MD -MT openmp/tools/omptest/CMakeFiles/omptest.dir/src/OmptTester.cpp.o -MF openmp/tools/omptest/CMakeFiles/omptest.dir/src/OmptTester.cpp.o.d -o openmp/tools/omptest/CMakeFiles/omptest.dir/src/OmptTester.cpp.o -c /home/tcwg-buildbot/llvm-project/openmp/tools/omptest/src/OmptTester.cpp
In file included from /home/tcwg-buildbot/llvm-project/openmp/tools/omptest/src/OmptTester.cpp:17:
In file included from /home/tcwg-buildbot/llvm-project/openmp/tools/omptest/include/OmptTester.h:49:
/home/tcwg-buildbot/llvm-project/openmp/tools/omptest/include/OmptTesterGoogleTest.h:27:10: fatal error: 'gtest/gtest.h' file not found
27 | #include "gtest/gtest.h"
| ^~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
```
I think this is happening because the include paths are added for `omptest_gtest` but not for `omptest`. This change "fixes" it:
```
diff --git a/openmp/tools/omptest/CMakeLists.txt b/openmp/tools/omptest/CMakeLists.txt
index e3af71c856ba..8e97d0dd00c5 100644
--- a/openmp/tools/omptest/CMakeLists.txt
+++ b/openmp/tools/omptest/CMakeLists.txt
@@ -84,6 +84,11 @@ if ((NOT LIBOMPTEST_BUILD_STANDALONE) OR LIBOMPTEST_BUILD_UNITTESTS)
"${OMPTEST_GTEST_PATH}/include"
)
+ target_include_directories(omptest PRIVATE
+ "${OMPTEST_GTEST_PATH}"
+ "${OMPTEST_GTEST_PATH}/include"
+ )
+
# Avoid using LLVM-specific ostream helpers inside GoogleTest.
target_compile_definitions(omptest_gtest PRIVATE GTEST_NO_LLVM_SUPPORT=1)
```
Does that make sense to you?
https://github.com/llvm/llvm-project/pull/159416
More information about the Openmp-commits
mailing list