1 |
commit: 571dd66bedd32f3f5fdf4a1609e2edfa3b76a0e9 |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 15 17:10:57 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 16 23:28:51 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=571dd66b |
7 |
|
8 |
toolchain-funcs.eclass: document proper tc-check-openmp use |
9 |
|
10 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
11 |
Closes: https://github.com/gentoo/gentoo/pull/25498 |
12 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
13 |
|
14 |
eclass/toolchain-funcs.eclass | 13 +++++++++++++ |
15 |
1 file changed, 13 insertions(+) |
16 |
|
17 |
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass |
18 |
index 9ad5e224b03e..54d4b0912a6e 100644 |
19 |
--- a/eclass/toolchain-funcs.eclass |
20 |
+++ b/eclass/toolchain-funcs.eclass |
21 |
@@ -611,6 +611,19 @@ tc-has-openmp() { |
22 |
# OpenMP support that has been requested by the ebuild. Using this function |
23 |
# to test for OpenMP support should be preferred over tc-has-openmp and |
24 |
# printing a custom message, as it presents a uniform interface to the user. |
25 |
+# |
26 |
+# You should test for any necessary OpenMP support in pkg_pretend in order to |
27 |
+# warn the user of required toolchain changes. You must still check for OpenMP |
28 |
+# support at build-time, e.g. |
29 |
+# @CODE |
30 |
+# pkg_pretend() { |
31 |
+# [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp |
32 |
+# } |
33 |
+# |
34 |
+# pkg_setup() { |
35 |
+# [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp |
36 |
+# } |
37 |
+# @CODE |
38 |
tc-check-openmp() { |
39 |
if ! _tc-has-openmp; then |
40 |
eerror "Your current compiler does not support OpenMP!" |