summaryrefslogtreecommitdiffstats
path: root/llvm/utils/gn/build/write_cmake_config.py
Commit message (Collapse)AuthorAgeFilesLines
* [gn build] Fix Python DeprecationWarningMarco Antognini2019-09-251-4/+10
| | | | | | | | | | | | | | | Summary: This fixes two issues: - DeprecationWarning: invalid escape sequence \` - ResourceWarning: unclosed file Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67753 llvm-svn: 372876
* Fixed error message printing in write_cmake_config.pyDmitri Gribenko2019-04-171-1/+4
| | | | | | | | | | | | | | Summary: Previously, write_cmake_config.py would raise an error while printing the error, because `leftovers` in "'\n'.join(leftovers)" is a tuple. Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60766 llvm-svn: 358557
* Make the write_cmake_config.py script python3-compatibleAlexander Kornienko2019-01-091-1/+1
| | | | llvm-svn: 350700
* gn build: Copy file permissions from input file in configure_file() emulation.Peter Collingbourne2019-01-091-0/+1
| | | | | | | | | Most significantly, this makes bin/llvm-lit executable so that it can be run in the usual way. Differential Revision: https://reviews.llvm.org/D56423 llvm-svn: 350688
* [gn build] Make write_cmake_config.py check that each key passed is uniqueNico Weber2019-01-041-0/+3
| | | | | | | | I got that wrong once while locally while working on check-llvm. Reviewed as part of https://reviews.llvm.org/D56195 llvm-svn: 350394
* [gn build] Add check-lld target and make it workNico Weber2018-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | Also add a build file for llvm-lit, which in turn needs llvm/tools/llvm-config. With this, check-lld runs and passes all of lld's lit tests. It doesn't run any of its unit tests yet. Running just ninja -C out/gn will build all prerequisites needed to run tests, but it won't run the tests (so that the build becomes clean after one build). Running ninja -C out/gn check-lld will build prerequisites if needed and run the tests. The check-lld target never becomes clean and runs tests every time. llvm-config's build file is a bit gnarly: Everything not needed to run tests is basically stubbed out. Also, to generate LibraryDependencies.inc we shell out to llvm-build at build-time. It would be much nicer to get the library dependencies by using the dependency data the GN build contains (http://llvm-cs.pcc.me.uk/gen/tools/llvm-config/LibraryDependencies.inc#1). Differential Revision: https://reviews.llvm.org/D55836 llvm-svn: 349702
* [gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gnNico Weber2018-12-061-12/+13
| | | | | | | | | | | | | | | Tweak write_cmake_config.py to also handle variable references looking @FOO@ (matching CMake's configure_file() function), and make it replace '\' 'n' in values with a newline literal since there's no good portable way of passing a real newline literal on a command line. Use that to process all the .def.in files in llvm/include/Config and add llvm/lib/Target/BUILD.gn, which (indirectly, through llvm-c/Target.h) includes them. Differential Revision: https://reviews.llvm.org/D55184 llvm-svn: 348503
* [gn build] Use print_function in write_cmake_config.pyNico Weber2018-12-031-3/+5
| | | | | | | | | No behavior change, just makes the script match the other scripts in llvm/utils/gn/build. Differential Revision: https://reviews.llvm.org/D55183 llvm-svn: 348190
* [gn build] Fix cosmetic bug in write_cmake_config.pyNico Weber2018-12-021-4/+4
| | | | | | | | | | | | Before, #cmakedefine FOO resulted in #define FOO with a trailing space if FOO was set to something truthy. Make it so that it's just #define FOO without a trailing space. No functional difference. Differential Revision: https://reviews.llvm.org/D55172 llvm-svn: 348107
* [gn build] Slightly simplify write_cmake_config.Nico Weber2018-12-021-27/+18
| | | | | | | | | | | | | | | | | | | Before, the script had a bunch of special cases for #cmakedefine and #cmakedefine01 and then did general variable substitution. Now, the script always does general variable substitution for all lines and handles the special cases afterwards. This has no observable effect for the inputs we use, but is easier to explain and slightly easier to implement. Also mention to link to CMake's configure_file() in the docstring. (The new behavior doesn't quite match CMake on lines like #cmakedefine ${FOO}, but nobody does that.) Differential Revision: https://reviews.llvm.org/D55171 llvm-svn: 348106
* [gn build] Set +x bit on .py files in llvm/utils/gn/build.Nico Weber2018-11-291-0/+1
| | | | | | Also add a shebang line to write_cmake_config.py. llvm-svn: 347928
* [gn build] Create abi-breaking.h, config.h, llvm-config.h, and add a build ↵Nico Weber2018-11-271-0/+109
file for llvm/lib/Support. The comments at the top of llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn and llvm/utils/gn/build/write_cmake_config.py should explain the main bits happening in this patch. The main parts here are that these headers are generated at build time, not gn time, and that currently they don't do any actual feature checks but just hardcode most things based on the current OS, which seems to work well enough. If this stops being enough, the feature checks should each be their own action writing the result to somewhere, and the config write step should depend on those checks (so that they can run in parallel and as part of the build) -- utils/llvm/gn/README.rst already has some more words on that in "Philosophy". (write_cmake_config.py is also going to be used to write clang's clang/include/clang/Config/config.h) This also adds a few files for linking to system libraries in a consistent way if needed in llvm/utils/gn/build/libs (and moves pthread to that model).0 I'm also adding llvm/utils/gn/secondary/llvm/lib/Target/targets.gni in this patch because $native_arch is needed for writing llvm-config.h -- the rest of it will be used later, when the build files for llvm/lib/Target get added. That file describes how to select which archs to build. As a demo, also add a build file for llvm-undname and make it the default build target (it depends on everything that can currently be built). Differential Revision: https://reviews.llvm.org/D54678 llvm-svn: 347636
OpenPOWER on IntegriCloud