From 38b959022cec1b865489d97a697eda84b49cc4e5 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Sat, 18 Jan 2020 00:36:08 +0100 Subject: Add support for building with MinGW (#9137) * Add support for building with MinGW Tested with MSYS2 MinGW 8.3.0, gcc-mcf.lhmouse MinGW 9.2.1, and StephanTLavavej/mingw-distro! * Add MinGW toolchain From your MinGW configured shell you could just use vcpkg to configure packages. An x64-mingw triplet would look like: ``` set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE static) set(VCPKG_ENV_PASSTHROUGH PATH) set(VCPKG_CMAKE_SYSTEM_NAME MinGW) ``` * Add MinGW community tripplets x64 tested with https://github.com/StephanTLavavej/mingw-distro x86, arm64, arm tested with https://github.com/mstorsjo/llvm-mingw --- toolsrc/include/pch.h | 4 ++++ toolsrc/include/vcpkg/base/files.h | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index ce2a7c9c5..a6a442f0a 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -31,7 +31,11 @@ #include #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #include +#if USE_STD_FILESYSTEM +#include +#else #include +#endif #include #include #include diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index e9d3d33bf..bb4a10d49 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -2,12 +2,20 @@ #include +#if USE_STD_FILESYSTEM +#include +#else #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #include +#endif namespace fs { +#if USE_STD_FILESYSTEM + namespace stdfs = std::filesystem; +#else namespace stdfs = std::experimental::filesystem; +#endif using stdfs::copy_options; using stdfs::path; -- cgit v1.2.3