This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add path to include generated headers for hermetic tests
ClosedPublic

Authored by jhuber6 on Apr 25 2023, 4:31 PM.

Details

Summary

The generated header files live in the build directory's include path.
When targeting a hermetic build we want to make sure we only use headers
generated by the project itself if availible.

Diff Detail

Event Timeline

jhuber6 created this revision.Apr 25 2023, 4:31 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 25 2023, 4:31 PM
jhuber6 requested review of this revision.Apr 25 2023, 4:31 PM
jhuber6 updated this revision to Diff 516987.Apr 25 2023, 4:58 PM

You need this include for all of them if we're building full standalone on the GPU. I'm not sure what a good way to express this is.

sivachandra added inline comments.Apr 25 2023, 10:27 PM
libc/test/UnitTest/CMakeLists.txt
29

Can we do:

if(LLVM_LIBC_FULL_BUILD)
  # If we are in full build mode, then we should use our own public headers.
  target_include_directories(${lib} PRIVATE ${LIBC_BUILD_DIR}/include)
endif()

We don't need the one on line 43?

jhuber6 updated this revision to Diff 517120.Apr 26 2023, 4:27 AM

Addressing comments

sivachandra accepted this revision.Apr 26 2023, 2:23 PM
sivachandra added inline comments.
libc/test/UnitTest/CMakeLists.txt
51

Nit: Move lines 56 and 57 above this if condition.

54

Remove these as they will be added outside of the if anyway.

This revision is now accepted and ready to land.Apr 26 2023, 2:23 PM