wenju-he wrote:

> @wenju-he @frasercrmck General question, how difficult would it be to port 
> this project to use `add_library` instead? We would need some custom language 
> support, that's just CMake boilerplate. Getting the final linked library can 
> easily be done with a custom command to call `llvm-link` as `llvm-link` on a 
> static library will link everything inside it.

Using `add_library` like other runtime library do should be the goal for 
libclc, see 
https://github.com/llvm/llvm-project/pull/156778#pullrequestreview-3183793268. 
Other than the cmake change and llvm-link you mentioned, I see three additional 
tasks:
1. Drop github.com/llvm/llvm-project/pull/156778 and refactor to avoid 
duplicates symbols in two files. I can take this task.
2. Remove .ll files which don't need clang compilation (the first 3 files will 
be removed by https://github.com/llvm/llvm-project/pull/157633):
https://github.com/llvm/llvm-project/blob/main/libclc/opencl/lib/generic/subnormal_disable.ll
https://github.com/llvm/llvm-project/blob/main/libclc/opencl/lib/generic/subnormal_helper_func.ll
https://github.com/llvm/llvm-project/blob/main/libclc/opencl/lib/generic/subnormal_use_default.ll
https://github.com/llvm/llvm-project/blob/main/libclc/opencl/lib/r600/image/get_image_attributes_impl.ll
https://github.com/llvm/llvm-project/blob/main/libclc/opencl/lib/r600/image/read_image_impl.ll
https://github.com/llvm/llvm-project/blob/main/libclc/opencl/lib/r600/image/write_image_impl.ll
3. Fix that CMAKE_C_COMPILER set during runtime build stage is ignored by cmake 
MSVC generator.

@frasercrmck please advice if something is missing.

https://github.com/llvm/llvm-project/pull/174022
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to