summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-09-03 14:11:46 -0700
committerKhem Raj <raj.khem@gmail.com>2022-09-03 14:15:44 -0700
commit9f245e4ee21d5b788787cbb26b8a52fd32d60775 (patch)
treee7fb5fb6308c854ae76d623bedb9ef2f40968a3e /classes
parentecf0f6aaaf12f60f88cfad0f6ff21a3d63e0119c (diff)
downloadmeta-clang-9f245e4ee21d5b788787cbb26b8a52fd32d60775.tar.gz
clang-native.bbclass: Move to classes folder
classes-recipe domain is new and will break kirkstone and need very recent bitbake, let it settle some dust before adopting it for meta-clang Fixes https://github.com/kraj/meta-clang/issues/651 Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/clang-native.bbclass23
1 files changed, 23 insertions, 0 deletions
diff --git a/classes/clang-native.bbclass b/classes/clang-native.bbclass
new file mode 100644
index 0000000..51fafcd
--- /dev/null
+++ b/classes/clang-native.bbclass
@@ -0,0 +1,23 @@
1# inherit this class if you would like to use clang to compile the native
2# version of your recipes instead of system compiler ( which is normally gcc )
3# on build machines
4# to use it add
5#
6# inherit clang-native
7#
8# to the concerned recipe via a bbappend or directly to recipe file
9#
10DEPENDS:append:runtime-llvm = " clang-native compiler-rt-native libcxx-native"
11# Use libcxx headers for native parts
12CXXFLAGS:append:runtime-llvm = " -stdlib=libc++"
13BUILD_CXXFLAGS:append:runtime-llvm = " -isysroot=${STAGING_DIR_NATIVE} -stdlib=libc++"
14# Use libgcc for native parts
15LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc"
16BUILD_LDFLAGS:append:runtime-llvm = " -stdlib=libc++ -rtlib=libgcc -unwindlib=libgcc"
17BUILD_CC:runtime-llvm = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE}"
18BUILD_CXX:runtime-llvm = "${CCACHE}clang++ -isysroot=${STAGING_DIR_NATIVE}"
19BUILD_CPP:runtime-llvm = "${CCACHE}clang -isysroot=${STAGING_DIR_NATIVE} -E"
20BUILD_CCLD:runtime-llvm = "${CCACHE}clang"
21BUILD_RANLIB:runtime-llvm = "llvm-ranlib"
22BUILD_AR:runtime-llvm = "llvm-ar"
23BUILD_NM:runtime-llvm = "llvm-nm"