aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/guess.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-05 11:34:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-05 11:34:47 +0200
commit4fe1c3c083acecf7eabe46b67cb540e8390f3122 (patch)
tree62f60d60ed49d037c00dd82b0c8f5ecacba32689 /libbuild2/cc/guess.cxx
parentb95fe77721b5d3f35d94e7f1292c9581034cd4bd (diff)
Add support for supplying MSVC IFCPATH equivalent
Diffstat (limited to 'libbuild2/cc/guess.cxx')
-rw-r--r--libbuild2/cc/guess.cxx28
1 files changed, 24 insertions, 4 deletions
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<dir_paths> lib_dirs;
optional<dir_paths> inc_dirs;
+ optional<dir_paths> mod_dirs;
string bpat;
if (const msvc_info* mi = static_cast<msvc_info*> (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};
}