Skip to content

Commit cefebaf

Browse files
committed
Rework printLibDir, printIncludeDir, printArchDir, printDspDir, printPaths functions to use C++17 filsesystem.
1 parent fbe0a3e commit cefebaf

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

.github/workflows/windows.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ jobs:
4141
with:
4242
msystem: MINGW64
4343
update: true
44-
install: >-
45-
base-devel
46-
git
47-
make
48-
python
49-
mingw-w64-x86_64-toolchain
44+
install: >-
45+
base-devel
46+
git
47+
make
48+
python
49+
mingw-w64-x86_64-toolchain
50+
mingw-w64-x86_64-cmake
5051
5152
- name: Build Faust with MSYS2
5253
shell: msys2 {0}

compiler/global.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <limits.h>
2323
#include <cstdint>
24+
#include <filesystem>
2425

2526
#include "absprim.hh"
2627
#include "acosprim.hh"
@@ -1999,11 +2000,6 @@ void global::parseSourceFiles()
19992000
/****************************************************************
20002001
Faust directories information
20012002
*****************************************************************/
2002-
#ifdef WIN32
2003-
#define kPSEP '\\'
2004-
#else
2005-
#define kPSEP '/'
2006-
#endif
20072003

20082004
#ifndef LIBDIR
20092005
#define LIBDIR "lib"
@@ -2547,27 +2543,27 @@ string global::printHelp()
25472543

25482544
string global::printLibDir()
25492545
{
2550-
stringstream sstr;
2551-
sstr << gFaustRootDir << kPSEP << LIBDIR << endl;
2552-
return sstr.str();
2546+
namespace fs = std::filesystem;
2547+
fs::path path = fs::path(gFaustRootDir) / "lib";
2548+
return path.string() + '\n';
25532549
}
25542550
string global::printIncludeDir()
25552551
{
2556-
stringstream sstr;
2557-
sstr << gFaustRootDir << kPSEP << "include" << endl;
2558-
return sstr.str();
2552+
namespace fs = std::filesystem;
2553+
fs::path path = fs::path(gFaustRootDir) / "include";
2554+
return path.string() + '\n';
25592555
}
25602556
string global::printArchDir()
25612557
{
2562-
stringstream sstr;
2563-
sstr << gFaustRootDir << kPSEP << "share" << kPSEP << "faust" << endl;
2564-
return sstr.str();
2558+
namespace fs = std::filesystem;
2559+
fs::path path = fs::path(gFaustRootDir) / "share" / "faust";
2560+
return path.string() + '\n';
25652561
}
25662562
string global::printDspDir()
25672563
{
2568-
stringstream sstr;
2569-
sstr << gFaustRootDir << kPSEP << "share" << kPSEP << "faust" << endl;
2570-
return sstr.str();
2564+
namespace fs = std::filesystem;
2565+
fs::path path = fs::path(gFaustRootDir) / "share" / "faust";
2566+
return path.string() + '\n';
25712567
}
25722568
string global::printPaths()
25732569
{

0 commit comments

Comments
 (0)