diff options
author | Goncalo Carvalho <glslang@gmail.com> | 2017-06-25 21:36:11 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-29 11:04:57 -0400 |
commit | bcb2556c69eddd3e34fbe89f36a23ae8821c682d (patch) | |
tree | 45267cfa29542173e82bb9bb7320f1d101701d7d /test cases/swift | |
parent | f12ece4547f7882027e7ebd916a5e5de13129ce8 (diff) | |
download | meson-bcb2556c69eddd3e34fbe89f36a23ae8821c682d.zip meson-bcb2556c69eddd3e34fbe89f36a23ae8821c682d.tar.gz meson-bcb2556c69eddd3e34fbe89f36a23ae8821c682d.tar.bz2 |
add project/global args and include_dirs (useful for module maps) to swift targets
Diffstat (limited to 'test cases/swift')
-rw-r--r-- | test cases/swift/6 modulemap/main.swift | 5 | ||||
-rw-r--r-- | test cases/swift/6 modulemap/meson.build | 8 | ||||
-rw-r--r-- | test cases/swift/6 modulemap/module.modulemap | 5 | ||||
-rw-r--r-- | test cases/swift/6 modulemap/mylib.c | 5 | ||||
-rw-r--r-- | test cases/swift/6 modulemap/mylib.h | 3 | ||||
-rw-r--r-- | test cases/swift/7 modulemap subdir/main.swift | 5 | ||||
-rw-r--r-- | test cases/swift/7 modulemap subdir/meson.build | 6 | ||||
-rw-r--r-- | test cases/swift/7 modulemap subdir/mylib/meson.build | 4 | ||||
-rw-r--r-- | test cases/swift/7 modulemap subdir/mylib/module.modulemap | 5 | ||||
-rw-r--r-- | test cases/swift/7 modulemap subdir/mylib/mylib.c | 5 | ||||
-rw-r--r-- | test cases/swift/7 modulemap subdir/mylib/mylib.h | 3 |
11 files changed, 54 insertions, 0 deletions
diff --git a/test cases/swift/6 modulemap/main.swift b/test cases/swift/6 modulemap/main.swift new file mode 100644 index 0000000..1a38c25 --- /dev/null +++ b/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/test cases/swift/6 modulemap/meson.build b/test cases/swift/6 modulemap/meson.build new file mode 100644 index 0000000..f1c90db --- /dev/null +++ b/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/test cases/swift/6 modulemap/module.modulemap b/test cases/swift/6 modulemap/module.modulemap new file mode 100644 index 0000000..5aab62e --- /dev/null +++ b/test cases/swift/6 modulemap/module.modulemap @@ -0,0 +1,5 @@ +module mylib [extern_c] { + header "mylib.h" + link "mylib" + export * +} diff --git a/test cases/swift/6 modulemap/mylib.c b/test cases/swift/6 modulemap/mylib.c new file mode 100644 index 0000000..e091836 --- /dev/null +++ b/test cases/swift/6 modulemap/mylib.c @@ -0,0 +1,5 @@ +#include"mylib.h" + +int getNumber() { + return 42; +} diff --git a/test cases/swift/6 modulemap/mylib.h b/test cases/swift/6 modulemap/mylib.h new file mode 100644 index 0000000..21bd9eb --- /dev/null +++ b/test cases/swift/6 modulemap/mylib.h @@ -0,0 +1,3 @@ +#pragma once + +int getNumber(); diff --git a/test cases/swift/7 modulemap subdir/main.swift b/test cases/swift/7 modulemap subdir/main.swift new file mode 100644 index 0000000..1a38c25 --- /dev/null +++ b/test cases/swift/7 modulemap subdir/main.swift @@ -0,0 +1,5 @@ +import mylib + +let num = getNumber() + +print("The number returned from C code is: \(num).") diff --git a/test cases/swift/7 modulemap subdir/meson.build b/test cases/swift/7 modulemap subdir/meson.build new file mode 100644 index 0000000..cd769eb --- /dev/null +++ b/test cases/swift/7 modulemap subdir/meson.build @@ -0,0 +1,6 @@ +project('mixed', 'c', 'swift') +add_project_arguments('-embed-bitcode', language : 'swift') +subdir('mylib') +exe = executable('prog', 'main.swift', + dependencies : dep) +test('c module', exe) diff --git a/test cases/swift/7 modulemap subdir/mylib/meson.build b/test cases/swift/7 modulemap subdir/mylib/meson.build new file mode 100644 index 0000000..2549e2b --- /dev/null +++ b/test cases/swift/7 modulemap subdir/mylib/meson.build @@ -0,0 +1,4 @@ + +i = include_directories('.') +lib = static_library('mylib', 'mylib.c') +dep = declare_dependency(include_directories : i, link_with : lib) diff --git a/test cases/swift/7 modulemap subdir/mylib/module.modulemap b/test cases/swift/7 modulemap subdir/mylib/module.modulemap new file mode 100644 index 0000000..5aab62e --- /dev/null +++ b/test cases/swift/7 modulemap subdir/mylib/module.modulemap @@ -0,0 +1,5 @@ +module mylib [extern_c] { + header "mylib.h" + link "mylib" + export * +} diff --git a/test cases/swift/7 modulemap subdir/mylib/mylib.c b/test cases/swift/7 modulemap subdir/mylib/mylib.c new file mode 100644 index 0000000..e091836 --- /dev/null +++ b/test cases/swift/7 modulemap subdir/mylib/mylib.c @@ -0,0 +1,5 @@ +#include"mylib.h" + +int getNumber() { + return 42; +} diff --git a/test cases/swift/7 modulemap subdir/mylib/mylib.h b/test cases/swift/7 modulemap subdir/mylib/mylib.h new file mode 100644 index 0000000..21bd9eb --- /dev/null +++ b/test cases/swift/7 modulemap subdir/mylib/mylib.h @@ -0,0 +1,3 @@ +#pragma once + +int getNumber(); |