diff options
Diffstat (limited to 'src/PkgConfig.cpp')
-rw-r--r-- | src/PkgConfig.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/PkgConfig.cpp b/src/PkgConfig.cpp index 3a36f39..faed146 100644 --- a/src/PkgConfig.cpp +++ b/src/PkgConfig.cpp @@ -1,5 +1,4 @@ #include "../include/PkgConfig.hpp" -#if OS_FAMILY == OS_FAMILY_POSIX #include "../include/Exec.hpp" #include "../include/Dependency.hpp" @@ -35,9 +34,9 @@ namespace sibs Result<bool> PkgConfig::validatePackageExists(const string &name) { - string command = "pkg-config --exists '"; - command += name; - command += "'"; + FileString command = TINYDIR_STRING("pkg-config --exists '"); + command += toFileString(name); + command += TINYDIR_STRING("'"); Result<ExecResult> execResult = exec(command.c_str()); if(execResult.isErr()) return Result<bool>::Err(execResult.getErrMsg()); @@ -69,11 +68,11 @@ namespace sibs // Use --modversion instead and check if the version returned is newer or equal to dependency version. // This way we can output installed version vs expected dependency version - string command = "pkg-config '--atleast-version="; - command += version; - command += "' '"; - command += name; - command += "'"; + FileString command = TINYDIR_STRING("pkg-config '--atleast-version="); + command += toFileString(version); + command += TINYDIR_STRING("' '"); + command += toFileString(name); + command += TINYDIR_STRING("'"); Result<ExecResult> execResult = exec(command.c_str()); if(execResult.isErr()) return Result<bool>::Err(execResult.getErrMsg()); @@ -112,8 +111,8 @@ namespace sibs args += "'"; } - string command = "pkg-config --libs"; - command += args; + FileString command = TINYDIR_STRING("pkg-config --libs"); + command += toFileString(args); Result<ExecResult> execResult = exec(command.c_str()); if(execResult.isErr()) return Result<string>::Err(execResult.getErrMsg()); @@ -155,8 +154,8 @@ namespace sibs args += "'"; } - string command = "pkg-config --cflags"; - command += args; + FileString command = TINYDIR_STRING("pkg-config --cflags"); + command += toFileString(args); Result<ExecResult> execResult = exec(command.c_str()); if(execResult.isErr()) return Result<string>::Err(execResult.getErrMsg()); @@ -202,5 +201,4 @@ namespace sibs flags.cflags = move(cflagsResult.unwrap()); return Result<PkgConfigFlags>::Ok(flags); } -} -#endif // OS_FAMILY_POSIX +}
\ No newline at end of file |