diff options
Diffstat (limited to 'libbuild2/cc/guess.hxx')
-rw-r--r-- | libbuild2/cc/guess.hxx | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/libbuild2/cc/guess.hxx b/libbuild2/cc/guess.hxx index 3c58bec..7cbbd87 100644 --- a/libbuild2/cc/guess.hxx +++ b/libbuild2/cc/guess.hxx @@ -19,12 +19,13 @@ namespace build2 // // Currently recognized compilers and their ids: // - // gcc GCC gcc/g++ - // clang Vanilla Clang clang/clang++ - // clang-apple Apple Clang clang/clang++ and the gcc/g++ "alias" - // msvc Microsoft cl.exe - // msvc-clang Clang in the cl compatibility mode (clang-cl) - // icc Intel icc/icpc + // gcc GCC gcc/g++ + // clang Vanilla Clang clang/clang++ + // clang-apple Apple Clang clang/clang++ and the gcc/g++ "alias" + // clang-emscripten Emscripten emcc/em++. + // msvc Microsoft cl.exe + // msvc-clang Clang in the cl compatibility mode (clang-cl) + // icc Intel icc/icpc // // Note that the user can provide a custom id with one of the predefined // types and a custom variant (say 'gcc-tasking'). @@ -83,7 +84,7 @@ namespace build2 // // Currently defined compiler classes: // - // gcc gcc, clang, clang-apple, icc (on non-Windows) + // gcc gcc, clang, clang-{apple,emscripten}, icc (on non-Windows) // msvc msvc, clang-cl, icc (Windows) // enum class compiler_class @@ -117,8 +118,9 @@ namespace build2 // // A compiler variant may also have a variant version: // - // clang-apple A.B[.C] ... {A, B, C, ...} - // msvc-clang A.B.C[( |-)...] {A, B, C, ...} (native Clang version) + // clang-apple A.B[.C] ... {A, B, C, ...} + // clang-emscripten A.B.C ... {A, B, C, ...} + // msvc-clang A.B.C[( |-)...] {A, B, C, ...} (native Clang version) // // Note that the clang-apple variant version is a custom Apple version // that doesn't correspond to the vanilla Clang version nor is the mapping @@ -171,6 +173,9 @@ namespace build2 // search paths (similar to the PATH environment variable), in which case // it will end with a directory separator but will not contain '*'. // + // Watch out for the environment variables affecting any of the extracted + // information (like sys_*_dirs) since we cache it. + // struct compiler_info { process_path path; @@ -211,6 +216,7 @@ namespace build2 // uclibc // musl // dietlibc + // emscripten // other // none // @@ -231,8 +237,14 @@ namespace build2 // entries, if extracted at the guess stage. // optional<pair<dir_paths, size_t>> sys_lib_dirs; - optional<pair<dir_paths, size_t>> sys_inc_dirs; + optional<pair<dir_paths, size_t>> sys_hdr_dirs; optional<pair<dir_paths, size_t>> sys_mod_dirs; + + // Optional list of environment variables that affect the compiler and + // its target platform. + // + const char* const* compiler_environment; + const char* const* platform_environment; }; // In a sense this is analagous to the language standard which we handle @@ -241,8 +253,10 @@ namespace build2 // that most of it will be the same, at least for C and C++. // const compiler_info& - guess (const char* xm, // Module (for var names in diagnostics). + guess (context&, + const char* xm, // Module (for var names in diagnostics). lang xl, // Language. + const string& ec, // Environment checksum. const path& xc, // Compiler path. const string* xi, // Compiler id (optional). const string* xv, // Compiler version (optional). @@ -262,6 +276,16 @@ namespace build2 const string& cid, const string& pattern, const strings& mode); + + // Insert importable/non-importable C++ standard library headers + // ([headers]/4). + // + // Note that the importable_headers instance should be unique-locked. + // + void + guess_std_importable_headers (const compiler_info&, + const dir_paths& sys_hdr_dirs, + importable_headers&); } } |