This patch provides a way to specify the default target cpu optimizations to use when compiling llvm-libc.
This ensures we don't rely on current compiler's default and allows compiling and cross compiling for a particular target.
Details
- Reviewers
sivachandra - Commits
- rGed4f4edea20c: [libc] Allow target architecture customization
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libc/cmake/modules/LLVMLibCLibraryRules.cmake | ||
---|---|---|
87 | We should not need to set compile options here. If you notice, the add_library rule on line 79 does not compile anything. It just packs a bunch of object files into a static archive. | |
116 | Same here as well. We should not need to set compile options. | |
libc/cmake/modules/LLVMLibCObjectRules.cmake | ||
155 | While you are at it, can you fix this: we should use the same default compile options for add_entrypoint_object and add_object_library above. So, essentially, I am saying that we should be sharing common_compiler_options between these two rules. |
- Remove unnecessary target_compile_options
- Use same common compile options between add_entrypoint_object and add_object_library
libc/cmake/modules/LLVMLibCObjectRules.cmake | ||
---|---|---|
49 | Instead of _set_*, I think a function with name _get_* will be more appropriate here. The function should also take an additional arg for the result: _get_all_compile_options(all_opts ...) target_compile_options(${fq_target_name} PRIVATE ${all_opts}) This probably a nitty comment but motivated by the fact that common is not suitable in add_object_library. |
libc/cmake/modules/LLVMLibCObjectRules.cmake | ||
---|---|---|
49 | I was pondering whether get or set was more suitable and I've been lazy : ) |
We should not need to set compile options here. If you notice, the add_library rule on line 79 does not compile anything. It just packs a bunch of object files into a static archive.