aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc
AgeCommit message (Collapse)AuthorFilesLines
2024-12-12Generalize to_target() to be usable in other contextsHEADmasterBoris Kolpackov1-2/+6
2024-12-12Increment load_generation between operations in batchBoris Kolpackov1-1/+1
2024-12-12Fix incorrect logic based on dry_run_option valueBoris Kolpackov1-3/+24
2024-12-06Adapt to renaming of some butl::{ucase,lcase,sanitize_identifier}() function ↵Karen Arutyunov1-2/+1
overloads
2024-11-26Sanitize as identifiers <name>/<type in config.import.<proj>.<name>.<type>Boris Kolpackov1-2/+7
2024-11-20Handle config.import.*.<name>.lib in cc::search_library()Boris Kolpackov1-25/+31
In particular, this provides support for using prefixed/suffixed installed libraries (GH issue #449).
2024-11-20Handle config.import.*.<name>.{liba,libs} in cc::search_library()Boris Kolpackov1-50/+205
In particular, this provides support for using prefixed/suffixed installed libraries (GH issue #449). Note that the current implementation only supports immediate import but it feels like this limitation can be removed with some effort in the future.
2024-11-18Only install runtime part of static library prerequisites of share libraries ↵Boris Kolpackov1-2/+20
(GH issue #448)
2024-11-18Drop some disabled code that is unlikely to be neededBoris Kolpackov1-132/+0
2024-10-29Add note on relative paths in compiledbBoris Kolpackov1-2/+12
2024-10-23Add config.cc.compiledb=<path> shortcut for placing file into source directoryBoris Kolpackov1-7/+105
2024-10-23Fix bug in compiledb parsing logic (GH issue #441)Boris Kolpackov1-5/+6
Also improve diagnostics around invalid compiledb format.
2024-10-09Add support for JSON compilation database generation and maintenanceBoris Kolpackov7-29/+1926
See the "Compilation Database" section in the "cc Module" chapter of the manual for details.
2024-10-08Add uxtheme.lib to list of Windows system librariesBoris Kolpackov1-0/+1
2024-10-03Make header cache case-sensitive on Windows (GH issue #390)Boris Kolpackov2-4/+29
2024-09-30Add ability to specify custom MSVC /MACHINE valueBoris Kolpackov1-10/+24
This, for example, can be used to link for ARM64EC instead of the default ARM64: "config.cxx=cl.exe /arm64EC" config.cc.loptions=/MACHINE:ARM64EC
2024-09-30Fix more issues in MSVC ARM64 supportBoris Kolpackov2-5/+11
2024-09-30Fix issues in MSVC ARM64 supportBoris Kolpackov2-11/+22
2024-09-05Fix bug in whole archive prerequisite change trackingBoris Kolpackov1-3/+3
2024-09-05Don't suppress duplicate libraries if linking whole archive (GH issue #411)Boris Kolpackov1-3/+10
2024-08-30Add absolute compiler path to compiler checksumBoris Kolpackov2-4/+9
In particular, this will allow us to use depdb change tracking to also detect changes to compilation database entries.
2024-08-28Don't assume preprocessed TU exists if reprocessing (GH issue #409)Boris Kolpackov1-2/+3
2024-08-06Add support for specifying compile options on exe/lib{} targetsBoris Kolpackov2-38/+354
It is now possible to specify compile option (*.poptions and *.coptions) on the exe/lib{} targets (we call them "binary-specific compile options"). Such options are propagated to obj/bmi{} targets that are synthesized for source prerequisites of the binary. Note that this propagation does not apply to obj/bmi{} prerequisites. For example: exe{foo}: cxx{foo} obj{common} { cxx.poptions += -DFOO } exe{bar}: cxx{bar} obj{common} { cxx.poptions += -DBAR } obj{common}: cxx{common} { cxx.poptions += -DCOMMON } In this example, cxx{foo} will be compiled with -DFOO, cxx{bar} -- with -DBAR, and cxx{common} -- with -DCOMMON. Note that if a source prerequisite is shared between several binaries, then the values of the propagated compile options (or their absence) must match. For instance, the following variant of the above example would result in an error since cxx{common} would have contradictory cxx.poptions values: exe{foo}: cxx{foo common} { cxx.poptions += -DFOO } exe{bar}: cxx{bar common} { cxx.poptions += -DBAR } As another example, here is how we can rewrite a typical library buildfile (which requires different macros to distinguish between shared/static builds) using this mechanism, in this case, to build two libraries in the same scope: ./: lib{foo}: {hxx cxx}{*-foo} ./: lib{bar}: {hxx cxx}{*-bar} cxx.poptions =+ "-I$out_root" "-I$src_root" lib{foo}: { cxx.poptions += -DFOO cxx.export.poptions = "-I$out_root" "-I$src_root" } liba{foo}: { cxx.poptions += -DLIBFOO_STATIC_BUILD cxx.export.poptions += -DLIBFOO_STATIC } libs{foo}: { cxx.poptions += -DLIBFOO_SHARED_BUILD cxx.export.poptions += -DLIBFOO_SHARED } lib{bar}: { cxx.poptions += -DBAR cxx.export.poptions = "-I$out_root" "-I$src_root" } liba{bar}: { cxx.poptions += -DLIBBAR_STATIC_BUILD cxx.export.poptions += -DLIBBAR_STATIC } libs{bar}: { cxx.poptions += -DLIBBAR_SHARED_BUILD cxx.export.poptions += -DLIBBAR_SHARED } The exact semantics of this mechanism is as-if the binary-specific compile options were set on the synthesized obj/bmi{} targets at the end of the buildfile. One nuance to keep in mind is that target type/pattern-specific assign/append/prepend specified for obj/bmi{} will not be in effect for options specified on lib/exe{}. For example: cxx.poptions += -DSCOPE obj{*}: cxx.poptions += -DTARGET exe{foo}: cxx.poptions += -DFOO Here the effective cxx.poptions for exe{foo} prerequisites will be -DSCOPE -DFOO since exe{foo} does not match the obj{*} pattern. As result, if using this mechanism, remember to include the binary target types in obj{} patterns. For example: {obj exe}{*}: cxx.poptions += -DTARGET
2024-07-31Add lookup limit to {scope,target}::lookup_original()Boris Kolpackov3-13/+13
2024-06-14Instrument header cache inconsistency assert with additional info (GH issue ↵Boris Kolpackov1-0/+14
#390)
2024-06-07Use combined -L option form for extra system search pathsBoris Kolpackov1-4/+10
The split one was just too much of an eye-sore in the logs.
2024-06-07Add comment on not adding rpath for /usr/local/libBoris Kolpackov1-0/+18
2024-06-05Improve -rpath duplicate suppression logic even moreBoris Kolpackov1-2/+11
2024-06-05Improve -rpath duplicate suppression logic some moreBoris Kolpackov1-3/+15
2024-06-05Include top-level libraries in -rpath duplicate suppression logicBoris Kolpackov1-0/+7
2024-06-04Update Apple Clang to vanilla Clang version mapping informationBoris Kolpackov1-21/+23
2024-05-15Add note on potentially mismatching cxx.std in module sidebuildsBoris Kolpackov1-0/+9
2024-05-14Add /Zc:preprocessor in experimental cxx.std mode from MSVC 17.9 (19.39)Boris Kolpackov1-1/+1
For background, see: https://developercommunity.visualstudio.com/t/Please-clarify-ifwhen-Zc:preprocessor/10537317
2024-05-13Issue better diagnostics if standard library modules not supportedBoris Kolpackov1-142/+150
2024-05-13Update std.cppm to Clang 18, add std.compat.cppmBoris Kolpackov4-80/+1087
Note that Clang 17 is not longer supported with regards to standard library modules.
2024-05-09Fixes and tweaks to diagnostics color support on Windows (GH issue #312)Boris Kolpackov1-1/+13
Specifically: - Pass -fansi-escape-codes for Clang on Windows. - Enable diagnostics color by default if already enabled on the terminal. Only try to enable it ourselves with explicit --diag-color.
2024-05-06Switch from libpkg-config to version from libbutlBoris Kolpackov1-1/+1
2024-02-26Add ability to serialize compilation/linking in cc rulesBoris Kolpackov4-8/+43
Specifically, both the C/C++ compiler and link rules now recognize the cc.serialize boolean variable which instructs them to compiler/link serially with regards to any other recipe. This is primarily useful when compiling large translation units or linking large binaries that require so much memory that doing that in parallel with other compilation/linking jobs is likely to summon the OOM killer. For example: obj{memory-hog}: cc.serialize = true
2024-02-22Detect dependency cycles in *.export.libsBoris Kolpackov1-0/+5
Fixes GH issue #362.
2024-02-22Detect non-cc::link_rule libraries not marked with cc.type=ccBoris Kolpackov1-4/+11
Fixes GH issue #368.
2024-02-22Deal with libs{} being member of group in windows_rpath_timestamp()Boris Kolpackov1-1/+14
Fixes GH issue #366.
2024-02-15Add fsdir{} duplicate suppression in more placesBoris Kolpackov2-2/+9
2024-02-06Fix bunch of maybe used uninitialized warningsBoris Kolpackov2-2/+3
2024-02-02Handle unseparated `rc` and `git` suffixes in Clang version (GH issue #360)Boris Kolpackov1-2/+38
2024-01-29Fix pkgconfig_load() to set common poptions for lib{} target groupKaren Arutyunov1-6/+47
2024-01-11Properly split injected ad hoc group member name in regex pattern ruleBoris Kolpackov1-1/+2
2024-01-10Add ability to specify alternative sysroot for pkg-config files (GC issue #59)Boris Kolpackov2-4/+65
Specifically, the new config.cc.pkgconfig.sysroot variable provides roughly equivalent functionality to PKG_CONFIG_SYSROOT_DIR in pkg-config. For details and limitations, see "Rewriting Installed Libraries System Root (sysroot)" in the manual for details.
2024-01-10Fix bunch of typosBoris Kolpackov4-6/+6
2024-01-09Disable use of -frewrite-includes for assembler with preprocessor filesBoris Kolpackov1-3/+24
With -frewrite-includes Clang has issues with correctly tracking location information (manifests itself as wrong line numbers in debug info, for example). The result also appears to reference the .Si file instead of the original source file for some reason. While at it also omit trying to scan such files since that can be hazardous (such files sometimes use `#`-style comments).
2024-01-08Allow specifying compiler mode options in buildfileBoris Kolpackov1-7/+20
Now the configured mode options are appended to buildfile-specified (which must be specified before loading the guess module). In particular, this ability to specify the compiler mode in a buildfile is useful in embedded development where the project may need to hardcode things like -target, -nostdinc, etc. For example: cxx.std = 20 cxx.mode = -target riscv32-unknown-unknown -nostdinc using cxx