mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-11-30 16:42:07 +00:00
edbfa3bfa9
* Restructured rules to match architecture * Added exports of all symbols in the deprecated location for legacy support * Updated examples
38 lines
1 KiB
Python
38 lines
1 KiB
Python
load("@rules_android//android:rules.bzl", "android_binary", "android_library")
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
|
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
|
|
|
|
cmake(
|
|
name = "libhello",
|
|
lib_source = "//cmake_hello_world_lib/static:srcs",
|
|
out_include_dir = "include/version123",
|
|
)
|
|
|
|
cc_library(
|
|
name = "hello_lib_usage_example",
|
|
srcs = ["hello_lib-example.cpp"],
|
|
linkstatic = True,
|
|
deps = [":libhello"],
|
|
alwayslink = True,
|
|
)
|
|
|
|
android_library(
|
|
name = "lib",
|
|
srcs = ["java/com/example/android/bazel/MainActivity.java"],
|
|
custom_package = "com.example.android.bazel",
|
|
manifest = "LibraryManifest.xml",
|
|
resource_files = glob(["res/**/*"]),
|
|
deps = [
|
|
":hello_lib_usage_example",
|
|
"@maven//:com_android_support_appcompat_v7",
|
|
"@maven//:com_android_support_constraint_constraint_layout",
|
|
],
|
|
)
|
|
|
|
android_binary(
|
|
name = "app",
|
|
custom_package = "com.example.android.bazel",
|
|
manifest = "AndroidManifest.xml",
|
|
deps = [":lib"],
|
|
)
|