diff options
author | Kelvin Zhang <zhangkelvin@google.com> | 2021-08-19 11:09:15 -0700 |
---|---|---|
committer | Kelvin Zhang <zhangkelvin@google.com> | 2021-08-19 14:32:36 -0700 |
commit | ddcf1d921ae03017580f44f9dcfaa278022e3c5a (patch) | |
tree | f56e568a43797af982f43298c0bf738a0c5b60a6 | |
parent | 011d854311a08d777daba6cf81fd41d62921827a (diff) | |
download | zucchini-ddcf1d921ae03017580f44f9dcfaa278022e3c5a.tar.gz |
Get zucchini to compile w/o code transformation hack
Test: th
Change-Id: I9b2beec4ee34d1ba23c1af24dec3f4b9169d6bd4
-rw-r--r-- | Android.bp | 24 | ||||
l--------- | aosp/include/components/zucchini | 1 | ||||
-rw-r--r-- | aosp/include/third_party/abseil-cpp/absl/types/optional.h (renamed from aosp/include/absl/types/optional.h) | 0 | ||||
-rwxr-xr-x | aosp/preprocess.py | 31 | ||||
-rw-r--r-- | buildflags.h (renamed from aosp/include/buildflags.h) | 0 |
5 files changed, 2 insertions, 54 deletions
@@ -98,26 +98,6 @@ filegroup { ], } -// The aosp versions of sources are preprocesseed with include -// re-written in an AOSP compatible way. Some headers, such as -// absl, are simply redirected to STL equivalent. -gensrcs { - name: "libzucchini_aosp_srcs", - cmd: "$(location aosp/preprocess.py) $(in) $(out)", - tool_files: ["aosp/preprocess.py"], - srcs: [":libzucchini_srcs"], - output_extension: "cc", -} - -gensrcs { - name: "libzucchini_aosp_headers", - cmd: "$(location aosp/preprocess.py) $(in) $(out)", - tool_files: ["aosp/preprocess.py"], - srcs: [":libzucchini_headers"], - export_include_dirs: ["."], - output_extension: "h", -} - cc_library { name: "libzucchini", @@ -126,10 +106,8 @@ cc_library { // instead of loacl ones. As the generated headers contain // incorrect include paths include_build_directory: false, - srcs: [":libzucchini_aosp_srcs"], - generated_headers: ["libzucchini_aosp_headers"], + srcs: [":libzucchini_srcs"], local_include_dirs: ["aosp/include"], - export_generated_headers: ["libzucchini_aosp_headers"], export_include_dirs: ["aosp/include"], static_libs: [ "libchrome", diff --git a/aosp/include/components/zucchini b/aosp/include/components/zucchini new file mode 120000 index 0000000..1b20c9f --- /dev/null +++ b/aosp/include/components/zucchini @@ -0,0 +1 @@ +../../../
\ No newline at end of file diff --git a/aosp/include/absl/types/optional.h b/aosp/include/third_party/abseil-cpp/absl/types/optional.h index 3321c72..3321c72 100644 --- a/aosp/include/absl/types/optional.h +++ b/aosp/include/third_party/abseil-cpp/absl/types/optional.h diff --git a/aosp/preprocess.py b/aosp/preprocess.py deleted file mode 100755 index 7a31ffc..0000000 --- a/aosp/preprocess.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python3 - -# ChromeOs version of zucchini expects to find its headers -# in a specifc path. In android the include paths are slightly -# different. Since we can't change upstream source code, we -# use this script to preprocess all files(.cc and ,h) and -# re-write all include paths - - -def main(argv): - if len(argv) != 3: - print("Usage:", argv[0], "<input path> <output path>") - return 1 - input_path = argv[1] - output_path = argv[2] - with open(input_path, "r") as infp, open(output_path, "w") as outfp: - for line in infp.readlines(): - line = line.replace('#include "components/zucchini/', - '#include "') - line = line.replace('#include <components/zucchini/', - '#include <') - line = line.replace('#include "third_party/abseil-cpp/', - '#include "') - line = line.replace('#include <third_party/abseil-cpp/', - '#include <') - outfp.write(line) - - -if __name__ == '__main__': - import sys - sys.exit(main(sys.argv)) diff --git a/aosp/include/buildflags.h b/buildflags.h index 2b63e59..2b63e59 100644 --- a/aosp/include/buildflags.h +++ b/buildflags.h |