<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58518>58518</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
libclc: doesn't respect `CMAKE_C_COMPILER_LAUNCHER`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
OpenCL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sylvestre
</td>
</tr>
</table>
<pre>
I am building libclc the following way:
```
cd libclc/build && \
cmake ../ \
-G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=/opt/sccache/sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/sccache/sccache \
-DCMAKE_C_COMPILER=/build/source/build-llvm/tools/clang/stage2-bins/bin/clang \
-DCMAKE_CXX_COMPILER=/build/source/build-llvm/tools/clang/stage2-bins/bin/clang++ \
-DCMAKE_C_FLAGS="-O2 -DNDEBUG -g1 -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" \
-DCMAKE_CXX_FLAGS="-O2 -DNDEBUG -g1 -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-z,relro -Wl,--build-id -L/build/source/build-llvm/tools/clang/stage2-bins/lib" \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,-z,relro -Wl,--build-id -L/build/source/build-llvm/tools/clang/stage2-bins/lib" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,relro -Wl,--build-id -L/build/source/build-llvm/tools/clang/stage2-bins/lib" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_DATADIR=lib \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DLLVM_CONFIG=/build/source/build-llvm/tools/clang/stage2-bins/bin/llvm-config \
-DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"; \
ninja -j 32 -v
```
However, the call to clang for C code doesn't use sccache
`[4/2583] /build/source/build-llvm/tools/clang/stage2-bins/bin/clang -DCLC_R600 -D__CLC_INTERNAL -I../generic/include -cl-no-stdinc -target r600-- -mcpu=cayman -fno-builtin -nostdlib -I /build/source/libclc/amdgpu/lib/math -o CMakeFiles/builtins.link.cayman-r600--.dir/amdgpu/lib/math/half_log2.bc -c ../amdgpu/lib/math/half_log2.cl -emit-llvm`
while it does for C++:
`[399/2583] /opt/sccache/sccache /build/source/build-llvm/tools/clang/stage2-bins/bin/clang++ -DHAVE_LLVM=0x1400 -O2 -DNDEBUG -g1 -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2 -I/build/source/llvm/include -I/build/source/build-llvm/tools/clang/stage2-bins/include -std=c++14 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -MD -MT CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o -MF CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o.d -o CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o -c ../utils/prepare-builtins.cpp`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzVVluTojoQ_jX4kgqloKgPPiCgQy3qlpfdOU9UCFEzE4gVgrOzv_404G1qnT2158zDnCrk0unufOn-uttEpq-jEJEMJSUXKc93SPCECor0nqGtFEK-VMIX8mrYrtH2jfb57rRPV_1J05OhYU1qV8iwHLiQ0fNOGhl5Zsg0QeEqxFM05_kTuZH43sz9EsRe7C1mX8MoWMaRu5l7D8HSsH0wlgcN94JSQvfs-oYuho-Pf2r6m80bw_pElYEsFWVnARbimMGHllIU8KSC5LtKS5M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