Fix MsWin missing directory exception, and ::std (#3928) (#3933) (#3935)

This commit is contained in:
Kritik Bhimani 2023-02-04 18:49:49 +05:30 committed by GitHub
parent 6908e471e7
commit dc9c81256d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -118,6 +118,7 @@ install(DIRECTORY include TYPE DATA FILES_MATCHING
PATTERN "include/verilated.mk"
PATTERN "include/*.[chv]"
PATTERN "include/*.cpp"
PATTERN "include/*.sv"
PATTERN "include/gtkwave/*.[chv]*"
PATTERN "include/vltstd/*.[chv]*"
)

View File

@ -489,8 +489,10 @@ string V3Options::fileExists(const string& filename) {
std::set<string>* setp = &(diriter->second);
#ifdef _MSC_VER
try {
for (const auto& dirEntry : std::filesystem::directory_iterator(dir.c_str()))
setp->insert(dirEntry.path().filename().string());
} catch(std::filesystem::filesystem_error const& ex) { return ""; }
#else
if (DIR* const dirp = opendir(dir.c_str())) {
while (struct dirent* direntp = readdir(dirp)) setp->insert(direntp->d_name);

View File

@ -267,11 +267,7 @@ private:
bool m_relativeIncludes = false; // main switch: --relative-includes
bool m_reportUnoptflat = false; // main switch: --report-unoptflat
bool m_savable = false; // main switch: --savable
#ifdef _MSC_VER
bool m_std = false; // main switch: --std
#else
bool m_std = true; // main switch: --std
#endif
bool m_structsPacked = false; // main switch: --structs-packed
bool m_systemC = false; // main switch: --sc: System C instead of simple C++
bool m_stats = false; // main switch: --stats