summaryrefslogtreecommitdiff
path: root/tests/test_cases/deps/prebuilt
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-01-19 17:59:49 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2023-01-20 16:21:19 +0100
commitc5c5117822f075603fd3dc67e3d19da8d2c8ec37 (patch)
tree8d87bc4056acd1c2e3c54b804bd17a3704515274 /tests/test_cases/deps/prebuilt
parent89b76f2558da0c41280b9eb389384824babfbef6 (diff)
downloadrules-cc-c5c5117822f075603fd3dc67e3d19da8d2c8ec37.tar.gz
Test pkg-config support for prebuilt libraries
Diffstat (limited to 'tests/test_cases/deps/prebuilt')
-rw-r--r--tests/test_cases/deps/prebuilt/TARGETS71
-rw-r--r--tests/test_cases/deps/prebuilt/bar.hpp8
-rw-r--r--tests/test_cases/deps/prebuilt/foo.hpp8
3 files changed, 80 insertions, 7 deletions
diff --git a/tests/test_cases/deps/prebuilt/TARGETS b/tests/test_cases/deps/prebuilt/TARGETS
index d94dea2..c923995 100644
--- a/tests/test_cases/deps/prebuilt/TARGETS
+++ b/tests/test_cases/deps/prebuilt/TARGETS
@@ -1,32 +1,68 @@
-{ "foo":
+{ "foo.pc":
+ { "type": "file_gen"
+ , "name": "foo.pc"
+ , "data":
+ { "type": "join"
+ , "separator": "\n"
+ , "$1":
+ [ "Name: foo"
+ , "Version: 1.2.3"
+ , "Description: test prebuilt foo"
+ , "URL: unknown"
+ , "Cflags: -I/usr/include -DUSE_FOO=1"
+ , "Libs: -L/usr/lib -lfoo -lpthread"
+ ]
+ }
+ }
+, "foo":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["foo"]
, "version": ["1", "2", "3"]
- , "hdrs": [["shared", "foo.hpp"]]
+ , "hdrs": ["foo.hpp"]
, "lib": [["shared", "foo"]]
+ , "pkg-config": ["foo.pc"]
, "stage": ["foo"]
}
, "foo_s":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["foo"]
, "version": ["1", "2", "3"]
- , "hdrs": [["shared", "foo.hpp"]]
+ , "hdrs": ["foo.hpp"]
, "lib": [["shared", "foo_s"]]
+ , "pkg-config": ["foo.pc"]
, "stage": ["foo"]
}
+, "bar.pc":
+ { "type": "file_gen"
+ , "name": "bar.pc"
+ , "data":
+ { "type": "join"
+ , "separator": "\n"
+ , "$1":
+ [ "Name: bar"
+ , "Version: unknown"
+ , "Description: test prebuilt bar"
+ , "URL: unknown"
+ , "Cflags: -I/usr/include -DUSE_BAR=1"
+ , "Libs: -L/usr/lib -lbar -lpthread -lm"
+ ]
+ }
+ }
, "bar":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["bar"]
- , "hdrs": [["shared", "bar.hpp"]]
+ , "hdrs": ["bar.hpp"]
, "lib": [["shared", "bar"]]
+ , "pkg-config": ["bar.pc"]
, "stage": ["bar"]
, "deps": ["foo"]
}
, "bar_s":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["bar"]
- , "hdrs": [["shared", "bar.hpp"]]
+ , "hdrs": ["bar.hpp"]
, "lib": [["shared", "bar_s"]]
+ , "pkg-config": ["bar.pc"]
, "stage": ["bar"]
, "deps": ["foo"]
}
@@ -66,22 +102,43 @@
, "test": [["shared", "test_uses_main.sh"]]
, "deps": ["main_uses_bar"]
}
+, "install_foo":
+ {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["foo"]}
+, "install_bar":
+ {"type": ["@", "rules", "CC", "install-with-deps"], "targets": ["bar"]}
, "install_main":
{ "type": ["@", "rules", "CC", "install-with-deps"]
, "targets": ["main_uses_bar"]
}
+, "foobar.pc":
+ { "type": "file_gen"
+ , "name": "foobar.pc"
+ , "data":
+ { "type": "join"
+ , "separator": "\n"
+ , "$1":
+ [ "Name: foobar"
+ , "Version: unknown"
+ , "Description: test compound prebuilt foobar"
+ , "URL: unknown"
+ , "Requires: bar, foo >= 1.2.3"
+ ]
+ }
+ }
, "foobar":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["foobar"]
- , "hdrs": [["shared", "bar.hpp"]]
+ , "hdrs": ["bar.hpp"]
, "lib": [["shared", "bar"], ["shared", "foo"]]
+ , "pkg-config": ["foobar.pc", "foo.pc", "bar.pc"]
, "stage": ["bar"]
}
, "foobar_s":
{ "type": ["@", "rules", "CC/prebuilt", "library"]
, "name": ["foobar"]
- , "hdrs": [["shared", "bar.hpp"]]
+ , "hdrs": ["bar.hpp"]
, "lib": [["shared", "bar_s"], ["shared", "foo_s"]]
+ , "pkg-config": ["foobar.pc", "foo.pc", "bar.pc"]
, "stage": ["bar"]
}
, "test_uses_foobar":
diff --git a/tests/test_cases/deps/prebuilt/bar.hpp b/tests/test_cases/deps/prebuilt/bar.hpp
new file mode 100644
index 0000000..243dba6
--- /dev/null
+++ b/tests/test_cases/deps/prebuilt/bar.hpp
@@ -0,0 +1,8 @@
+#ifndef BAR_HPP
+#define BAR_HPP
+
+#ifdef USE_BAR
+int bar();
+#endif
+
+#endif
diff --git a/tests/test_cases/deps/prebuilt/foo.hpp b/tests/test_cases/deps/prebuilt/foo.hpp
new file mode 100644
index 0000000..4f040d4
--- /dev/null
+++ b/tests/test_cases/deps/prebuilt/foo.hpp
@@ -0,0 +1,8 @@
+#ifndef FOO_HPP
+#define FOO_HPP
+
+#ifdef USE_FOO
+int foo();
+#endif
+
+#endif