Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libclc: use cmake-qemu to clean up recipe #992

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions recipes-devtools/clang/libclc_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ TOOLCHAIN = "clang"

LIC_FILES_CHKSUM = "file://libclc/LICENSE.TXT;md5=7cc795f6cbb2d801d84336b83c8017db"

inherit cmake pkgconfig python3native qemu
inherit cmake cmake-qemu pkgconfig python3native

DEPENDS += "qemu-native clang spirv-tools spirv-llvm-translator spirv-llvm-translator-native ncurses"
DEPENDS += "clang spirv-tools spirv-llvm-translator spirv-llvm-translator-native ncurses"

OECMAKE_SOURCEPATH = "${S}/libclc"

Expand All @@ -23,22 +23,10 @@ EXTRA_OECMAKE += "\
-DLLVM_OPT=${STAGING_BINDIR_NATIVE}/opt \
-DLLVM_SPIRV=${STAGING_BINDIR_NATIVE}/llvm-spirv \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \
-Dclc_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeCLCCompiler.cmake.in \
-Dll_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeLLAsmCompiler.cmake.in \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON"

do_configure:prepend () {
# Write out a qemu wrapper that will be used by cmake
# so that it can run target helper binaries through that.
qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}"
cat > ${WORKDIR}/qemuwrapper << EOF
#!/bin/sh
$qemu_binary "\$@"
EOF
chmod +x ${WORKDIR}/qemuwrapper
}

FILES:${PN} += "${datadir}/clc"

BBCLASSEXTEND = "native nativesdk"
Expand Down