From 5250cb90406693163763a214af95f670e0e3a4e0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 5 Oct 2018 05:02:49 +0200 Subject: Add cross compilation (mingw-w64 x86_64) Currently only cross compiling from linux64 to win64 works. Need to test cross compilation more, currently the cross compilation uses same profile as GCC, is that correct? --- include/Conf.hpp | 7 +++++-- include/FileUtil.hpp | 1 + include/PkgConfig.hpp | 2 ++ include/Platform.hpp | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/Conf.hpp b/include/Conf.hpp index 17ecc6b..15c8471 100644 --- a/include/Conf.hpp +++ b/include/Conf.hpp @@ -107,7 +107,8 @@ namespace sibs enum class Compiler { GCC, - MSVC + MSVC, + MINGW_W64 }; enum class CVersion @@ -303,7 +304,8 @@ namespace sibs showWarnings(false), zigTestAllFiles(false), packaging(false), - bundling(false) + bundling(false), + platform(SYSTEM_PLATFORM) { cmakeDirGlobal = projectPath; cmakeDirStatic = cmakeDirGlobal; @@ -504,6 +506,7 @@ namespace sibs bool packaging; bool bundling; std::string version; + Platform platform; protected: virtual void processObject(StringView name) override; virtual void processField(StringView name, const ConfigValue &value) override; diff --git a/include/FileUtil.hpp b/include/FileUtil.hpp index 3e2e302..0106c19 100644 --- a/include/FileUtil.hpp +++ b/include/FileUtil.hpp @@ -60,6 +60,7 @@ namespace sibs Result getRealPath(const _tinydir_char_t *path); bool pathEquals(const std::string &path, const std::string &otherPath); Result getFileLastModifiedTime(const _tinydir_char_t *path); + Result copyFile(const FileString &src, const FileString &dst); } #endif //SIBS_FILEUTIL_HPP diff --git a/include/PkgConfig.hpp b/include/PkgConfig.hpp index 2a52f2b..9181a2f 100644 --- a/include/PkgConfig.hpp +++ b/include/PkgConfig.hpp @@ -5,6 +5,7 @@ #include "Result.hpp" #include #include +#include "FileUtil.hpp" namespace sibs { @@ -19,6 +20,7 @@ namespace sibs class PkgConfig { public: + static void setPkgConfigPath(const FileString &path); static Result validatePkgConfigPackageVersionExists(PackageListDependency *dependency); static Result validatePackageExists(const std::string &name); static Result validatePackageVersionAtLeast(const std::string &name, const std::string &version); diff --git a/include/Platform.hpp b/include/Platform.hpp index 995d307..74b3a3d 100644 --- a/include/Platform.hpp +++ b/include/Platform.hpp @@ -50,4 +50,5 @@ namespace sibs bool containsPlatform(const std::vector &platforms, Platform platform); const char* asString(Platform platform); Platform getPlatformByName(StringView name); + bool isSamePlatformFamily(Platform a, Platform b); } \ No newline at end of file -- cgit v1.2.3