From 4fe1c3c083acecf7eabe46b67cb540e8390f3122 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Nov 2019 11:34:47 +0200 Subject: Add support for supplying MSVC IFCPATH equivalent --- libbuild2/cc/guess.cxx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'libbuild2/cc/guess.cxx') diff --git a/libbuild2/cc/guess.cxx b/libbuild2/cc/guess.cxx index c37b6b6..053a4cb 100644 --- a/libbuild2/cc/guess.cxx +++ b/libbuild2/cc/guess.cxx @@ -1360,7 +1360,7 @@ namespace build2 // do that probably first checking if they exist/empty). // static dir_paths - msvc_include (const msvc_info& mi) + msvc_inc (const msvc_info& mi) { dir_paths r; @@ -1382,6 +1382,19 @@ namespace build2 return r; } + // Return the MSVC system module search paths (i.e., what the Visual + // Studio command prompt puts into IFCPATH). + // + static dir_paths + msvc_mod (const msvc_info& mi, const char* cpu) + { + dir_paths r; + + r.push_back ((dir_path (mi.msvc_dir) /= "ifc") /= cpu); + + return r; + } + // Return the MSVC system library search paths (i.e., what the Visual // Studio command prompt puts into LIB). // @@ -1601,10 +1614,11 @@ namespace build2 // If we have the MSVC installation information, then this means we are // running out of the Visual Studio command prompt and will have to - // supply PATH/INCLUDE/LIB equivalents ourselves. + // supply PATH/INCLUDE/LIB/IFCPATH equivalents ourselves. // optional lib_dirs; optional inc_dirs; + optional mod_dirs; string bpat; if (const msvc_info* mi = static_cast (gr.info.get ())) @@ -1612,7 +1626,9 @@ namespace build2 const char* cpu (msvc_cpu (target_triplet (t).cpu)); lib_dirs = msvc_lib (*mi, cpu); - inc_dirs = msvc_include (*mi); + inc_dirs = msvc_inc (*mi); + mod_dirs = msvc_mod (*mi, cpu); + bpat = msvc_bin (*mi, cpu); } @@ -1654,7 +1670,8 @@ namespace build2 move (csl), move (xsl), move (lib_dirs), - move (inc_dirs)}; + move (inc_dirs), + move (mod_dirs)}; } static compiler_info @@ -1852,6 +1869,7 @@ namespace build2 move (csl), move (xsl), nullopt, + nullopt, nullopt}; } @@ -2438,6 +2456,7 @@ namespace build2 move (csl), move (xsl), move (lib_dirs), + nullopt, nullopt}; } @@ -2743,6 +2762,7 @@ namespace build2 move (csl), move (xsl), nullopt, + nullopt, nullopt}; } -- cgit v1.1