summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-12 22:59:59 +0800
committerruki <[email protected]>2020-10-12 22:59:59 +0800
commitc79cdeab5474507647f1c29b2cb759550f98e8b6 (patch)
treee414374cef6a4f5c460e1f5dba23eb8f3d8aa268 /tests
parent55209d22fedd5a0ea5323e81356cfe0c88603f30 (diff)
add libomp for openmp examples
Diffstat (limited to 'tests')
-rw-r--r--tests/projects/openmp/hello/src/main.c2
-rw-r--r--tests/projects/openmp/hello/xmake.lua3
2 files changed, 4 insertions, 1 deletions
diff --git a/tests/projects/openmp/hello/src/main.c b/tests/projects/openmp/hello/src/main.c
index cea215566..54ba9db96 100644
--- a/tests/projects/openmp/hello/src/main.c
+++ b/tests/projects/openmp/hello/src/main.c
@@ -5,7 +5,7 @@ int main(int argc, char** argv)
{
#pragma omp parallel
{
- printf("hello %d\n", omp_get_thread_num());
+ printf("hello %d\n", omp_get_thread_num());
}
return 0;
}
diff --git a/tests/projects/openmp/hello/xmake.lua b/tests/projects/openmp/hello/xmake.lua
index 685a6a34b..c1f837287 100644
--- a/tests/projects/openmp/hello/xmake.lua
+++ b/tests/projects/openmp/hello/xmake.lua
@@ -1,3 +1,6 @@
+add_requires("libomp", {optional = true})
target("hello")
set_kind("binary")
add_files("src/*.c")
+ add_rules("c.openmp")
+ add_packages("libomp")