summaryrefslogtreecommitdiff
path: root/CC/RULES
AgeCommit message (Collapse)Author
2025-05-28rules documentation: Fix typosPaul Cristian Sarbu
2025-05-08Merge branch 'just-rules' into rulesKlaus Aehlig
2025-05-08rules: Allow all false values to disable DEBUGKlaus Aehlig
While activating DEBUG requires setting it to a non-empty map, providing information on whether and how debugg fission should be used, we should still allow any logically false value (rather than just null) to disable a debug build in order to make it easier for the user to explicitly disable debugging. Also adopt and fix the documentation strings.
2025-04-23Merge commit '20b7c7fa1b10a90e0e3aad46579ebe450d6720b9' into HEADPaul Cristian Sarbu
2025-04-23rules CC: Add DWP configuration variablePaul Cristian Sarbu
...defining the DWARF format packaging tool to use once debug fission is supported.
2025-04-23rules CC: Make DEBUG variable a mapPaul Cristian Sarbu
It expects now the key 'USE_DEBUG_FISSION', which enables debug fission, but does not add any flags on its own. For this, the 'FISSION_CONFIG' key is expected with certain entries that provide the compile and/or link flags that configure debug fission. The flags are added only where needed, i.e., before running or storing the respective compile or link actions.
2025-04-23rules CC: Use the -g flag as fallback in debug mode...Paul Cristian Sarbu
...if no flags are otherwise configured (by toolchain or rule-specific configuration variables).
2025-04-23rules CC defaults: Add DEBUGFLAGS and ADD_DEBUGFLAGS config varsPaul Cristian Sarbu
If in debug mode - DEBUGFLAGS replaces any resulting CFLAGS and CXXFLAGS, and - ADD_DEBUGFLAGS is appended to the resulting debug compile flags.
2024-12-19rules-cc: Add support for include scanningOliver Reiche
... which is configured using a new defaults field "include_scanner", a tool (script/binary) that generates a new include tree without unused headers. Example implementations are provided.
2024-11-06Merge branch 'just-rules' into rulesKlaus Aehlig
2024-11-06Prefer built-in "nub_left"Klaus Aehlig
Now that justbuild 1.4 is available, the workaround of defining "nub_left" in terms of "reverse" and "nub_right" is no longer necessary.
2024-08-29["CC", "library"]: document additional providersKlaus Aehlig
2024-08-14Merge branch 'just-rules' into rulesKlaus Aehlig
2024-08-14Make CC binary and library support providing information for lintingKlaus Aehlig
If the configuration variable "LINT" is set, also provide information on compile actions and header files (with preprocessing as described command, in particular also providing the correct flags) in correct dependency context. In this way, lint rules can request the needed information for performing their checks.
2024-08-07Merge branch 'just-rules' into rulesKlaus Aehlig
2024-08-07Add field to ["CC", "defaults"] to specify arguments for arKlaus Aehlig
... instead of hard-coding ["cqs"].
2024-07-25["CC", "library"] Add concept of componentsKlaus Aehlig
... i.e., dependencies that are to be included into the library itself. In this way, a large library (convenient for a user to have single library to care about) can be defined as a collection of smaller libraries. Technically, components are like public dependencies on libraries transitioned to object libraries with the following differences - the header files (i.e., runfiles) of the components become header files of the resulting libary, and - the objects (i.e., artifacts) of the components become objects of the library rather than link dependencies. To achive the transfer of the object to the requesting library, an object library can be instructed to drop the objects from the link arguments; in order to continue to support tranditional object libraries in the style of, e.g., cmake, this is done by a different configuration variable that is transitioned as well. In particular, the object-library test case (using a configure target) can be left unchanged.
2024-07-25["CC", "library"]: Make object-only a configuration propertyKlaus Aehlig
... instead of a property of the library itself. An object library is not a meaningful concept in itself; it only exists, because a consumer wants to link the library in its entirety. But consumer-specified properties should be propagated through configuration transitions and the definition of the library should not care about how it is consumed; this is also the approach we follow with respect to building a library position independent. As oposed to position-independent building, however, the property of being included unconditionally is not propagated transitively.
2024-06-25Merge commit 'c301e85a61dc6e43b8cc6ce8f44a902c392163a2' into HEADPaul Cristian Sarbu
2024-06-25CC defaults: Provide the debug stage also for implicit depsPaul Cristian Sarbu
This ensures that one can inspect, e.g., generated protobuf source files (.pb.cc) or standard library headers while debugging proto libraries or general C++ libraries and binaries, respectively.
2024-06-03debug rule: Fix staging of headersPaul Cristian Sarbu
For libraries the headers of private dependencies were wrongly skipped from staging. For binaries, no headers were passed at all in the provides map. To fix these issues, an additional field is added in the provides map to ensure we collect, and then properly stage, all needed headers for both libraries and binaries.
2024-06-03debug rule: Add flag field to skip installing extra debug artifactsPaul Cristian Sarbu
This is useful when we want to install targets built in debug mode, but do not want to stage all the additional source and header files if no debugging is being performed, e.g., in tests.
2024-06-03debug rule: Fix staging of headersPaul Cristian Sarbu
For libraries the headers of private dependencies were wrongly skipped from staging. For binaries, no headers were passed at all in the provides map. To fix these issues, an additional field is added in the provides map to ensure we collect, and then properly stage, all needed headers for both libraries and binaries.
2024-06-03debug rule: Add flag field to skip installing extra debug artifactsPaul Cristian Sarbu
This is useful when we want to install targets built in debug mode, but do not want to stage all the additional source and header files if no debugging is being performed, e.g., in tests.
2024-05-13Merge commit '07924d28e81fe36ddb8e020552a7392fcf1227a0' into HEADPaul Cristian Sarbu
2024-05-13rules: Support staging debug artifacts in install-with-deps rulePaul Cristian Sarbu
The existing rule is extended to also stage source files if in debug mode, in order for a debugger to be able to find all needed symbols. Conflicting paths are allowed; in case of conflicts, the file from the closest target in the dependency chain wins.
2024-05-03Implement object_only libraryOliver Reiche
2024-04-29Merge branch 'just-rules' into rulesKlaus Aehlig
2024-04-29["CC", "defaults"] rule: Add "ADD_COMPILE_FLAGS"Klaus Aehlig
The C++ programming language is tightly related to the C programming language. Consequently, the command line interface for C and C++ are also related and share quite a number of compile flags. Honor this tight connection by have in our defaults a field allowing to extend both compile flags, those for C as well as those for C++. In this way, build defaults can be described in a more readable way.
2023-11-20rules: Fix flag inheritanceOliver Reiche
... which should accumulate values from all base targets unless the flag type (CFLAGS, CXXFLAGS, or LDFLAGS) is explicity overwritten by the inheritor.
2023-11-20defaults: Fix flag inheritanceOliver Reiche
... which should accumulate values from all base targets unless the flag type (CFLAGS, CXXFLAGS, or LDFLAGS) is explicity overwritten by the inheritor.
2023-08-21Merge branch 'just-rules' into rulesKlaus Aehlig
2023-08-21rules: Add documentation for the implict dependenciesKlaus Aehlig
2023-08-16Merge branch 'rules/oss' into rules/rules-cc-rulesOliver Reiche
2023-08-16rules: Support BUILD_ARCH for CC defaultsOliver Reiche
2023-08-16rules: Propagate PATH list from defaultsOliver Reiche
... instead of creating an ENV from it and propagating this. The idea is to keep PATH entries separate and only join them with ":" when we need it. In this way, we can accumulate PATHs from multiple defaults later, and perform a deduplication ("nub_left") to shorten the final string length.
2023-08-16rules: Extend toolchains via defaults from baseOliver Reiche
2023-06-16rules: Install pkgconfig files to $PREFIX/lib/pkgconfigOliver Reiche
2023-05-31Change install location of pkg-config files in install-with-deps ruleSascha Roloff
2023-05-30rules-cc: Support for external toolchainsOliver Reiche
2023-05-30rules-cc: Use field_map_provider for default-ENVOliver Reiche
2023-05-30rules-cc: Fix missing LDFLAGS propagationOliver Reiche
2023-05-30rules: Support for external toolchainsOliver Reiche
2023-05-30rules: Use field_map_provider for default-ENVOliver Reiche
2023-04-19["CC", "defaults"] add basic field documentationKlaus Aehlig
2023-04-18Merge commit '0db46fe'Klaus Aehlig
2023-04-18Merge commit '9e061c2'Klaus Aehlig
2023-04-18rules: Support hdrs-only for install-with-deps ruleOliver Reiche
2023-04-18rules: Move install-with-deps to EXPRESSIONSOliver Reiche
2023-04-18rules: Support install-with-deps ruleOliver Reiche
Backport of commits a382b308b9011606e7d07376808812d51631d558 and 5ae5134804b6edaaffec593868f133dd840ef7df from the rules-cc repository.