aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/compile-rule.hxx
AgeCommit message (Collapse)AuthorFilesLines
2022-06-24Add ability to get common interface options via $x.lib_poptions()Boris Kolpackov1-2/+2
Specifically, the output target type may now be omitted for utility libraries (libul{} and libu[eas]{}). In this case, only "common interface" options will be returned for lib{} dependencies. This is primarily useful for obtaining poptions to be passed to tools other than C/C++ compilers (for example, Qt moc).
2022-04-19Use target recipe for auxiliary data storage during match-applyBoris Kolpackov1-2/+3
In particular, we now have separate auxiliary data storage for inner and outer operations.
2022-04-14Add header cache to cc::compile_rule::enter_header()Boris Kolpackov1-2/+5
2022-04-06Add support for rule hintsBoris Kolpackov1-1/+1
A rule hint is a target attribute, for example: [rule_hint=cxx] exe{hello}: c{hello} Rule hints can be used to resolve ambiguity when multiple rules match the same target as well as to override an unambiguous match.
2021-11-30Add support for dynamic dependencies as byproduct of script bodyBoris Kolpackov1-1/+1
Specifically, the `depdb dyndep` builtin now has the --byproduct option (which must come first). In this mode only the --file input is supported. For example: obje{hello.o}: cxx{hello} {{ o = $path($>) t = $(o).t depdb dyndep --byproduct --what=header --default-type=h --file $t diag c++ ($<[0]) $cxx.path $cxx.poptions $cc.poptions $cc.coptions $cxx.coptions $cxx.mode -o $o -MD -MF $t -c $path($<[0]) }} Naturally, this mode does not support dynamic auto-generated prerequisites. If present, such prerequisites must be specified statically in the buildfile. Note also that the --default-prereq-type option has been rename to --default-type.
2021-11-23Add support for dynamic dependencies in ad hoc Buildscript recipesBoris Kolpackov1-33/+11
Specifically, add the new `depdb dyndep` builtin that can be used to extract dynamic dependencies from a program run or a file. For example: obje{hello.o}: cxx{hello} {{ s = $path($<[0]) depdb dyndep $cxx.poptions $cc.poptions --what=header --default-prereq-type=h -- $cxx.path $cxx.poptions $cc.poptions $cxx.mode -M -MG $s diag c++ ($<[0]) o = $path($>) $cxx.path $cxx.poptions $cc.poptions $cc.coptions $cxx.coptions $cxx.mode -o $o -c $s }} Currently only the `make` dependency format is supported.
2021-11-05Keep multiple prefixless entries for generated header mappingBoris Kolpackov1-3/+4
2021-10-01Add notion of internal scope, translate external -I to -isystem or equivalentBoris Kolpackov1-1/+3
2021-08-10Complete process_libraries() duplicate suppression workBoris Kolpackov1-2/+2
2021-08-05Implement traversal pruning in process_libraries()Boris Kolpackov1-1/+2
2021-05-13Rename sys_inc_dirs to sys_hdr_dirs for consistencyBoris Kolpackov1-1/+1
2021-05-13Add ${c,cxx}.find_system_{header,library}() functionsBoris Kolpackov1-0/+4
2021-03-16Define intermediate build results file cache interfaceBoris Kolpackov1-3/+3
2021-02-03Propagate relevant options/prerequisites to header unit sidebuildsBoris Kolpackov1-2/+3
2020-12-11Minor module mapper fixesBoris Kolpackov1-1/+1
2020-12-11Add support for module interface-only librariesBoris Kolpackov1-1/+1
Also suppress generation of the object file in cases where we don't need it.
2020-12-01Modules-related refactoringBoris Kolpackov1-3/+4
2020-11-30Start adapting module mapper to latest GCC protocolBoris Kolpackov1-1/+1
2020-11-23Suppress duplicates when extracting library options (GitHub issue #114)Boris Kolpackov1-12/+14
2020-11-11Add ${c,cxx}.lib_{poptions,libs,rpaths}() functionsBoris Kolpackov1-11/+22
These functions can be used to query library metadata for options and libraries that should be used when compiling/linking dependent targets, similar to how cc::{compile,link}_rule do it. With this support it should be possible to more or less re-create their semantics in ad hoc recipes.
2020-07-13Add ability to extend rule interface in source-compatible mannerBoris Kolpackov1-1/+1
2020-02-11Defer unknown header failure to compiler diagnosticsBoris Kolpackov1-1/+1
2020-02-07Drop copyright notice from source codeKaren Arutyunov1-1/+0
2019-10-18Add ability to specify "compiler mode" options as part of config.{c,cxx}Boris Kolpackov1-6/+6
Such options are (normally) not overridden by buildfiles and are passed last (after cc.coptions and {c,cxx}.coptions) in the resulting command lines. They are also cross-hinted between config.c and config.cxx. For example: $ b config.cxx="g++ -m64"
2019-10-14Implement MSVC installation discovery for version 15 (2017) and laterKaren Arutyunov1-8/+6
In particular, this removes the requirement to build from the Visual Studio command prompt. Note that since MSVC compiler binaries are target-specific (i.e., there are no -m32/-m64 options nor something like /MACHINE), in this case we default to a 64-bit build (a 32-bit build can still be achieved by running from a suitable command prompt). Finally, this mechanism is also used to find Clang bundled with MSVC.
2019-08-28Move cc build system module to separate libraryKaren Arutyunov1-0/+189