// file : build2/cc/link -*- C++ -*- // copyright : Copyright (c) 2014-2016 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef BUILD2_CC_LINK #define BUILD2_CC_LINK #include #include #include #include #include #include namespace build2 { namespace cc { class link: public rule, virtual common { public: link (data&&); virtual match_result match (action, target&, const string& hint) const; virtual recipe apply (action, target&, const match_result&) const; target_state perform_update (action, target&) const; target_state perform_clean (action, target&) const; private: friend class compile; void process_libraries (file&, bool, bool, const function&, const function&) const; void append_libraries (strings&, file&, bool) const; void hash_libraries (sha256&, file&, bool) const; file& resolve_library (name, scope&, lorder, optional&) const; // Extract system library search paths from GCC or compatible (Clang, // Intel) using the -print-search-dirs option. // void gcc_library_search_paths (scope&, dir_paths&) const; // Extract system library search paths from VC (msvc.cxx). // void msvc_library_search_paths (scope&, dir_paths&) const; dir_paths extract_library_paths (scope&) const; bool pkgconfig_extract (scope&, file&, const string*, const string&, const dir_path&, optional&, lorder) const; // Alternative search logic for VC (msvc.cxx). // bin::liba* msvc_search_static (const process_path&, const dir_path&, const prerequisite_key&) const; bin::libs* msvc_search_shared (const process_path&, const dir_path&, const prerequisite_key&) const; target* search_library (optional& spc, prerequisite& p, lorder lo) const { if (p.target == nullptr) // First check the cache. p.target = search_library (spc, p.key (), lo); return p.target; } // Note that pk's scope should not be NULL (even if dir is absolute). // target* search_library (optional&, const prerequisite_key&, lorder) const; // Windows-specific (windows-manifest.cxx). // path windows_manifest (file&, bool rpath_assembly) const; private: const string rule_id; }; } } #endif // BUILD2_CC_LINK