// file : libbuild2/cc/module.hxx -*- C++ -*- // license : MIT; see accompanying LICENSE file #ifndef LIBBUILD2_CC_MODULE_HXX #define LIBBUILD2_CC_MODULE_HXX #include #include #include #include #include #include #include #include #include namespace build2 { namespace cc { struct compiler_info; class LIBBUILD2_CC_SYMEXPORT config_module: public build2::module, public config_data { public: explicit config_module (config_data&& d) : config_data (move (d)) {} // We split the configuration process into into two parts: guessing the // compiler information and the actual configuration. This allows one to // adjust configuration (say the standard or enabled experimental // features) base on the compiler information by first loading the // guess module. // void guess (scope&, const location&, const variable_map&); void init (scope&, const location&, const variable_map&); // Translate the x.std value (if any) to the standard-selecting // option(s) (if any). May also check/set x.features.* variables on the // root scope. // virtual strings translate_std (const compiler_info&, scope&, const string*) const = 0; strings tstd; const compiler_info* x_info; // Temporary storage for data::sys_*_dirs_*. // size_t sys_lib_dirs_mode; size_t sys_inc_dirs_mode; size_t sys_mod_dirs_mode; size_t sys_lib_dirs_extra; size_t sys_inc_dirs_extra; private: // Defined in gcc.cxx. // pair gcc_header_search_dirs (const process_path&, scope&) const; pair gcc_library_search_dirs (const process_path&, scope&) const; // Defined in msvc.cxx. // pair msvc_header_search_dirs (const process_path&, scope&) const; pair msvc_library_search_dirs (const process_path&, scope&) const; private: bool new_; // See guess() and init() for details. }; class LIBBUILD2_CC_SYMEXPORT module: public build2::module, public virtual common, link_rule, compile_rule, install_rule, libux_install_rule { public: explicit module (data&& d) : common (move (d)), link_rule (move (d)), compile_rule (move (d)), install_rule (move (d), *this), libux_install_rule (move (d), *this) {} void init (scope&, const location&, const variable_map&); }; } } #endif // LIBBUILD2_CC_MODULE_HXX