| # Copyright 2021 The IREE Authors |
| # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| # See https://llvm.org/LICENSE.txt for license information. |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| """Generates a compilation flagfile for iree-compiler. |
| This tool is added due to CMake's incapabilities on generating files with |
| multiple lines. CMake's configure_file doesn't work in our case as it can't be |
| """Parses command line arguments.""" |
| parser = argparse.ArgumentParser() |
| "--output", type=str, required=True, help="output file to write to" |
| metavar="<compilation-flags>", |
| help="list of compilation flags", |
| return parser.parse_args() |
| with open(args.output, "w") as f: |
| f.write("\n".join(args.compilation_flags) + "\n") |
| if __name__ == "__main__": |