vcpkg/toolsrc/include/pch.h

70 lines
1.4 KiB
C
Raw Normal View History

2017-01-28 04:49:09 +08:00
#pragma once
#if defined(_MSC_VER) && _MSC_VER < 1911
// [[nodiscard]] is not recognized before VS 2017 version 15.3
#pragma warning(disable : 5030)
#endif
#if defined(__GNUC__) && __GNUC__ < 7
// [[nodiscard]] is not recognized before GCC version 7
#pragma GCC diagnostic ignored "-Wattributes"
#endif
#if defined(_WIN32)
2017-01-28 04:49:09 +08:00
#define NOMINMAX
2017-03-28 15:02:33 +08:00
#define WIN32_LEAN_AND_MEAN
2017-10-03 07:55:06 +08:00
#pragma warning(suppress : 4768)
#include <windows.h>
#pragma warning(suppress : 4768)
#include <Shlobj.h>
#include <process.h>
#include <shellapi.h>
#include <winhttp.h>
#else
#include <unistd.h>
#endif
2017-03-28 15:02:33 +08:00
#include <algorithm>
2017-01-28 06:33:54 +08:00
#include <array>
#include <atomic>
2017-03-28 15:02:33 +08:00
#include <cassert>
#include <cctype>
#include <chrono>
#include <codecvt>
#include <cstdarg>
#include <cstddef>
2017-03-28 15:02:33 +08:00
#include <cstdint>
VS 2019 16.3 deprecates <experimental/filesystem>. (#6968) VS 2019 16.3 will contain a couple of source-breaking changes: * <experimental/filesystem> will be deprecated via an impossible-to-miss preprocessor "#error The <experimental/filesystem> header providing std::experimental::filesystem is deprecated by Microsoft and will be REMOVED. It is superseded by the C++17 <filesystem> header providing std::filesystem. You can define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING to acknowledge that you have received this warning." * <filesystem> will no longer include <experimental/filesystem>. In the long term, I believe that vcpkg should detect when it's being built with VS 2017 15.7 or newer, compile in C++17 mode, include <filesystem>, and use std::filesystem. (Activating this for VS 2019 16.0 or newer would also be reasonable.) Similarly for other toolsets supporting std::filesystem. In the short term, this commit makes vcpkg compatible with the upcoming deprecation. First, we need to define the silencing macro before including the appropriate header. I've chosen to define it unconditionally (without checking for platform or version), since it has no effect for other platforms or versions. Second, we need to deal with <filesystem> no longer including <experimental/filesystem>. I verified that VS 2015 Update 3 contained <experimental/filesystem> (back then, it simply included the <filesystem> header, where the experimental implementation was defined; this was later reorganized). Therefore, all of vcpkg's supported MSVC toolsets have <experimental/filesystem>, so we can simply always include it. I've verified that this builds with both VS 2015 Update 3 and VS 2019 16.1.3 (the current production version).
2019-06-21 02:46:55 +08:00
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
#include <experimental/filesystem>
#include <cstring>
2017-01-28 06:33:54 +08:00
#include <fstream>
#include <functional>
2017-03-28 15:02:33 +08:00
#include <iomanip>
#include <iostream>
2017-01-28 04:49:09 +08:00
#include <iterator>
2017-03-28 15:02:33 +08:00
#include <map>
#include <memory>
#include <mutex>
#include <random>
2017-03-28 15:02:33 +08:00
#include <regex>
#include <set>
#include <stdexcept>
#include <string>
#if defined(_WIN32)
2017-01-28 06:33:54 +08:00
#include <sys/timeb.h>
#else
#include <sys/time.h>
#endif
#include <sys/types.h>
2017-03-28 15:02:33 +08:00
#include <system_error>
#include <thread>
2017-01-28 06:33:54 +08:00
#include <time.h>
#include <type_traits>
2017-03-28 15:02:33 +08:00
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>