This rule can help add targets to generate special object files like the
crt1.o on linux. Also, it can be used to add specially compiled object
stubs which are to be linked into the entrypoint objects.
Details
- Reviewers
abrachet - Commits
- rG768ead0a6ca7: [libc] Add a new rule `add_object`.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Could you show how you are using this? I have tried like:
add_object( special SRC special.cpp COMPILE_OPTIONS -Wframe-larger-than=0 ) add_entrypoint_object( entrypoint SRCS entrypoint.cpp HDRS entrypoint.h DEPENDS special )
Doesn't work, entrypoint doesn't link against special.o
libc/cmake/modules/LLVMLibCRules.cmake | ||
---|---|---|
112 | Won't add_library compile using CMAKE_CXX_FLAGS? |
I have explained how to use it on the sigaction review page.
libc/cmake/modules/LLVMLibCRules.cmake | ||
---|---|---|
112 | Yes, but any new compile options you add get added at the end and hence will override (if required) the options earlier in the line. |
libc/cmake/modules/LLVMLibCRules.cmake | ||
---|---|---|
134 | Looks like object libraries don't give us the flexibility to customize the location and name of the generated object files. I will submit after removing lines 134 to 146 which seem to be doing nothing for an object library. |
Won't add_library compile using CMAKE_CXX_FLAGS?