diff options
Diffstat (limited to 'meson/test cases/swift/6 modulemap')
-rw-r--r-- | meson/test cases/swift/6 modulemap/main.swift | 5 | ||||
-rw-r--r-- | meson/test cases/swift/6 modulemap/meson.build | 8 | ||||
-rw-r--r-- | meson/test cases/swift/6 modulemap/module.modulemap | 5 | ||||
-rw-r--r-- | meson/test cases/swift/6 modulemap/mylib.c | 5 | ||||
-rw-r--r-- | meson/test cases/swift/6 modulemap/mylib.h | 3 |
5 files changed, 26 insertions, 0 deletions
diff --git a/meson/test cases/swift/6 modulemap/main.swift b/meson/test cases/swift/6 modulemap/main.swift new file mode 100644 index 000000000..1a38c2596 --- /dev/null +++ b/meson/test cases/swift/6 modulemap/main.swift @@ -0,0 +1,5 @@ +import mylib + +let num = getNumber() + +print("The number returned from C code is: \(num).") diff --git a/meson/test cases/swift/6 modulemap/meson.build b/meson/test cases/swift/6 modulemap/meson.build new file mode 100644 index 000000000..f1c90db97 --- /dev/null +++ b/meson/test cases/swift/6 modulemap/meson.build @@ -0,0 +1,8 @@ +project('mixed', 'c', 'swift') + +i = include_directories('.') +lib = static_library('mylib', 'mylib.c') +exe = executable('prog', 'main.swift', + include_directories : [i], + link_with : lib) +test('c module', exe) diff --git a/meson/test cases/swift/6 modulemap/module.modulemap b/meson/test cases/swift/6 modulemap/module.modulemap new file mode 100644 index 000000000..5aab62e97 --- /dev/null +++ b/meson/test cases/swift/6 modulemap/module.modulemap @@ -0,0 +1,5 @@ +module mylib [extern_c] { + header "mylib.h" + link "mylib" + export * +} diff --git a/meson/test cases/swift/6 modulemap/mylib.c b/meson/test cases/swift/6 modulemap/mylib.c new file mode 100644 index 000000000..e091836bc --- /dev/null +++ b/meson/test cases/swift/6 modulemap/mylib.c @@ -0,0 +1,5 @@ +#include"mylib.h" + +int getNumber() { + return 42; +} diff --git a/meson/test cases/swift/6 modulemap/mylib.h b/meson/test cases/swift/6 modulemap/mylib.h new file mode 100644 index 000000000..21bd9eb0b --- /dev/null +++ b/meson/test cases/swift/6 modulemap/mylib.h @@ -0,0 +1,3 @@ +#pragma once + +int getNumber(); |