================ @@ -249,13 +249,19 @@ function(add_libclc_builtin_set) get_filename_component( file_dir ${file} DIRECTORY ) + if( ARG_ARCH STREQUAL spirv OR ARG_ARCH STREQUAL spirv64 ) + set(CONVERT_DEP clspv-generate_convert.cl) + else() + set(CONVERT_DEP generate_convert.cl) + endif() + compile_to_bc( TRIPLE ${ARG_TRIPLE} INPUT ${input_file} OUTPUT ${output_file} EXTRA_OPTS -fno-builtin -nostdlib "${ARG_COMPILE_FLAGS}" -I${CMAKE_CURRENT_SOURCE_DIR}/${file_dir} - DEPENDENCIES generate_convert.cl clspv-generate_convert.cl + DEPENDENCIES ${CONVERT_DEP} ---------------- frasercrmck wrote:
I think really we should be passing in dependencies as an ARG. I've never like the hard-coding of the `*convert.cl` files here in a helper function. I also have the feeling that CMake should be able to automatically infer the right dependencies transitively, given that it knows that `clspv-generate_convert.cl` is a `DEPENDENCY` of `clspv-convert.cl` which is an `INPUT`. I'd have to do some experimentation, though. I always forget exactly how CMake works in this regard. The way we're currently specifying dependencies on `generate_convert.cl` et al is far too coarse, and means we unnecessary rebuild all libclc files when the conversion files change. https://github.com/llvm/llvm-project/pull/127315 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits