msbuilds now writes a custom props file to disable 4566

This commit is contained in:
isanae
2020-05-13 12:37:16 -04:00
parent 953df021c8
commit 0f28408e8d
6 changed files with 29 additions and 4 deletions
-2
View File
@@ -1,4 +1,2 @@
#include "pch.h"
#pragma warning(disable: 4566) // character cannot be represented in CP
#include <fmt/format.cc>
-1
View File
@@ -43,7 +43,6 @@
#pragma warning(disable: 4242) // possible loss of data
#pragma warning(disable: 4244) // possible loss of data
#pragma warning(disable: 4275) // non dll-interface base
#pragma warning(disable: 4566) // character cannot be represented in CP
#include <string>
+1 -1
View File
@@ -126,7 +126,7 @@ void python::build_and_install_from_source()
.projects({
"python", "pythonw", "python3dll", "select", "pyexpat",
"unicodedata", "_queue", "_bz2", "_ssl"})
.parameters({
.parameters({
"bz2Dir=" + path_to_utf8(bzip2::source_path()),
"zlibDir=" + path_to_utf8(zlib::source_path()),
"opensslIncludeDir=" + path_to_utf8(openssl::include_path()),
+25
View File
@@ -60,6 +60,8 @@ int msbuild::result() const
void msbuild::do_run()
{
write_custom_props_file();
// 14.2 to v142
const auto toolset = "v" + replace_all(tools::vs::toolset(), ".", "");
@@ -132,4 +134,27 @@ void msbuild::do_run()
execute_and_join();
}
void msbuild::write_custom_props_file()
{
const fs::path file = sln_.parent_path() / "Directory.Build.props";
if (fs::exists(file))
{
cx_->trace(context::generic, "props file {} already exists", file);
return;
}
const std::string content = R"(<!-- generated by mob.exe -->
<Project>
<ItemDefinitionGroup>
<ClCompile>
<DisableSpecificWarnings>4566</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
</Project>
)";
op::write_text_file(*cx_, file, content);
}
} // namespace
+2
View File
@@ -284,6 +284,8 @@ private:
std::string platform_;
arch arch_;
flags_t flags_;
void write_custom_props_file();
};
+1
View File
@@ -21,6 +21,7 @@
<ObjectFileName>$(IntDir)fake\%(RelativeDir)</ObjectFileName>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING;CURL_STATICLIB;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\third-party\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4566</DisableSpecificWarnings>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\third-party\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>