aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/module.cxx
AgeCommit message (Collapse)AuthorFilesLines
2023-10-26WIP: installBoris Kolpackov1-0/+3
2023-09-08Manually extract library search paths from LIBRARY_PATH for ClangBoris Kolpackov1-4/+4
Unlike GCC, Clang does not incorporate the LIBRARY_PATH environment variable value into the -print-search-dirs output.
2023-09-07Add implied .../MacOSX*.sdk/usr/lib/ to system library search directoriesBoris Kolpackov1-7/+22
2023-08-22Consider *_inc{} target types as headers for rule match purposesBoris Kolpackov1-3/+3
2023-04-18Add support for Assembler with C Preprocessor (.S) compilationBoris Kolpackov1-2/+2
Specifically, the c module now provides the c.as-cpp submodules which can be loaded in order to register the S{} target type and enable Assembler with C Preprocessor compilation in the c compile rule. For details, refer to "Assembler with C Preprocessor Compilation" in the manual.
2023-04-10Fix inconsistent /usr/local/{include,lib} searchBoris Kolpackov1-12/+29
In particular, we were adding -L/usr/local/lib which means it is considered before built-in directories (/usr/lib, etc) but in our own library search code we were considering it after (because we were storing it at the end of sys_lib_dirs). Now in both sys_{hdr,lib}_dirs we store /usr/local/{include,lib} after mode and before built-in directories. Note that as part of this fix we now pass -isystem /usr/local/include instead of -idirafter (which is consistent with the -L behavior and also the customarily expected semantics).
2022-11-22Add support for Objective-C/C++ compilation in cc moduleBoris Kolpackov1-0/+3
2022-11-08More work on child process diagnostics bufferingBoris Kolpackov1-1/+5
2022-10-13Optimize by going straight to public variable pool where applicableBoris Kolpackov1-1/+4
2022-10-10Preparatory work for public/private variable distinctionBoris Kolpackov1-3/+5
We still always use the public var_pool from context but where required, all access now goes through scope::var_pool().
2022-04-06Add support for rule hintsBoris Kolpackov1-12/+12
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-10-04Optimize internal scope implementationBoris Kolpackov1-27/+29
2021-10-01Add notion of internal scope, translate external -I to -isystem or equivalentBoris Kolpackov1-12/+113
2021-05-13Rename sys_inc_dirs to sys_hdr_dirs for consistencyBoris Kolpackov1-22/+22
2021-04-22Incorporate project environment checksum into cc::compiler_info cache keyBoris Kolpackov1-1/+3
2021-04-20Detect environment changes in ad hoc recipesBoris Kolpackov1-3/+2
2021-04-20Track changes to environment in cc rulesBoris Kolpackov1-0/+14
2021-04-07Register environment variables for hermetic build configurationsBoris Kolpackov1-0/+3
2021-03-09Remove stray trailing whitespaces from diagnosticsBoris Kolpackov1-1/+1
2021-01-30Add std::{map, multimap} to types.hxxBoris Kolpackov1-1/+0
Seeing that std::map is becoming a common Buildfile variable type.
2021-01-30Rework include translation supportBoris Kolpackov1-59/+77
See the config.cxx.translate_include variable documentation in cxx/init.cxx for details.
2020-12-15Cache more results of executing programs (compilers, etc)Boris Kolpackov1-20/+65
2020-11-11Add ${c,cxx}.lib_{poptions,libs,rpaths}() functionsBoris Kolpackov1-3/+15
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-11-05Initial Emscripten supportBoris Kolpackov1-19/+42
- Target: wasm32-emscripten (wasm32-unknown-emscripten). - Compiler id: clang-emscripten (type clang, variant emscripten, class gcc). - Ability to build executables (.js plus .wasm) and static libraries (.a). Set executable bit on the .js file (so it can be executed with a suitable binfmt interpreter). - Default config.bin.lib for wasm32-emscripten is static instead of both. - Full C++ exception support is enable unless disabled explicitly by the user with -s DISABLE_EXCEPTION_CATCHING=1|2. - The bin module registers the wasm{} target type for wasm32-emscripten.
2020-07-16Save original compiler path/mode in {c,cxx}.config.path/modeBoris Kolpackov1-1/+7
It turns out that when propagating {c,cxx}.config in tests we don't want to propagate any options (such as *.std) that have been folded into our project's mode.
2020-07-13Fold translated *.std options into compiler mode optionsBoris Kolpackov1-10/+4
This way they are accessible in ad hoc recipes.
2020-06-02Add process_path_ex with program stable name and checksumBoris Kolpackov1-1/+1
2020-04-02Fix ~host config to only contain cc and bin modules configurationBoris Kolpackov1-1/+1
Also add ~build2 that contains everything (except config.dist.*) to be used for build system modules.
2020-03-31Switch to project variable visibility by defaultBoris Kolpackov1-3/+6
2020-03-20Generate common .pc file in addition to static/staged when installing lib{}Boris Kolpackov1-0/+1
The common .pc file is produced by ignoring any static/shared-specific poptions and splitting loptions/libs into Libs/Libs.private. It is "best effort", in a sense that it's not guaranteed to be sufficient in all cases, but it will probably cover the majority of cases, even on Windows, thanks to automatic dllimport'ing of functions.
2020-03-17Rework config::{omitted,required,optional}() into unified config_lookup()Boris Kolpackov1-24/+29
2020-03-11Minor config variable lookup cleanupsBoris Kolpackov1-5/+16
2020-02-24Work around bug in Clang 10 targeting MSVC in c++2a (LLVM bug #44956)Boris Kolpackov1-1/+1
2020-02-07Drop copyright notice from source codeKaren Arutyunov1-1/+0
2020-02-03Fix bug in sys_*_dirs commitBoris Kolpackov1-1/+1
2020-02-03Add header/library search paths from compiler mode to sys_*_dirsBoris Kolpackov1-21/+29
2020-01-28Use scope::var_pool()Boris Kolpackov1-1/+1
2020-01-27Add corner case check in const.{c,cxx} array splittingBoris Kolpackov1-8/+11
2019-11-08Redo Apple /usr/include detection using patternsBoris Kolpackov1-16/+8
This should cover XCode 11 where the symlinks are the other way around now (see homebrew-core issue #46393 for details).
2019-11-05Add support for supplying MSVC IFCPATH equivalentBoris Kolpackov1-0/+12
2019-10-18Add ability to specify "compiler mode" options as part of config.{c,cxx}Boris Kolpackov1-119/+165
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-11Add support for clang-clBoris Kolpackov1-5/+27
The compiler type is `msvc`, variant `clang`.
2019-10-07Pass MSVC system library search paths to linker if LIB envvar is unsetBoris Kolpackov1-54/+67
2019-10-05Implement more accurate MSVC information extraction from Clang on WindowsBoris Kolpackov1-0/+1
2019-09-18Rename importable_headers variable to translatable_headersBoris Kolpackov1-8/+8
This name aligns better with the post-Cologne importable/translatable semantics.
2019-08-28Move cc build system module to separate libraryKaren Arutyunov1-0/+781