// file : libbuild2/cc/common.txx -*- C++ -*- // license : MIT; see accompanying LICENSE file namespace build2 { namespace cc { // Insert a target "tagging" it with the specified process path and // verifying that it already exists if requested. Return the lock. // template ulock common:: insert_library (context& ctx, T*& r, string name, dir_path dir, const process_path& out, optional ext, bool exist, tracer& trace) { auto p (ctx.targets.insert_locked (T::static_type, move (dir), path_cast (out.effect), name, move (ext), target_decl::implied, trace)); assert (!exist || !p.second); r = &p.first.template as (); return move (p.second); } } }