// 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 #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 (scope&, lorder, const dir_paths&, file&, bool, const function&, const function&, const function&, bool = false) const; void append_libraries (strings&, file&, bool, scope&, lorder) const; void hash_libraries (sha256&, file&, bool, scope&, lorder) const; void rpath_libraries (strings&, target&, scope&, lorder, bool) const; // Windows rpath emulation (windows-rpath.cxx). // struct windows_dll { const string& dll; const string* pdb; // NULL if none. string pdb_storage; bool operator< (const windows_dll& y) const {return dll < y.dll;} }; using windows_dlls = std::set; timestamp windows_rpath_timestamp (file&, scope&, lorder) const; windows_dlls windows_rpath_dlls (file&, scope&, lorder) const; void windows_rpath_assembly (file&, scope&, lorder, const string&, timestamp, bool) const; file& resolve_library (name, scope&, lorder, const dir_paths&, optional&) const; dir_paths extract_library_dirs (scope&) const; bool pkgconfig_extract (scope&, bin::lib&, bin::liba*, bin::libs*, const string*, const string&, const dir_path&, const dir_paths&) 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 (const dir_paths& sysd, optional& usrd, prerequisite& p) const { if (p.target == nullptr) // First check the cache. p.target = search_library (sysd, usrd, p.key ()); return p.target; } target* search_library (const dir_paths&, optional&, const prerequisite_key&) const; // Windows-specific (windows-manifest.cxx). // path windows_manifest (file&, bool rpath_assembly) const; private: const string rule_id; }; } } #endif // BUILD2_CC_LINK