Use alternative warning suppression

This commit is contained in:
Christian Semmler 2023-12-06 12:57:40 -05:00
parent a7b81539b1
commit e180ac848c
3 changed files with 11 additions and 7 deletions

View File

@ -219,6 +219,7 @@ if (MINGW)
target_compile_definitions(lego1 PRIVATE DIRECTINPUT_VERSION=0x0500)
endif()
# Additional include directories
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/3rdparty/vec")
target_include_directories(lego1 PRIVATE "${CMAKE_SOURCE_DIR}/3rdparty/flic")
@ -276,10 +277,16 @@ if (ISLE_BUILD_APP)
endif()
if (MSVC)
# Remove "identifier was truncated to '255' characters" warnings from output.
# Impossible to avoid this if using STL map or set.
# Unfortunately, MSVC4 has a bug that makes it impossible
# to get rid of this warning by using the standard #pragma directive.
configure_file("compile.cmd" "compile.cmd")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "compile.cmd < NUL")
# These flags have been taken from the defaults for a Visual C++ 4.20 project (the compiler the
# game was originally built with) and tweaked slightly to produce more debugging info for reccmp.
# They ensure a recompilation that can be byte/instruction accurate to the original binaries.
target_compile_options(isle PRIVATE "/ML$<$<CONFIG:Debug>:d>")
target_compile_options(lego1 PRIVATE "/MT$<$<CONFIG:Debug>:d>")

View File

@ -18,12 +18,6 @@
// Impossible to avoid this if using STL map or set.
// This removes most (but not all) occurrences of the warning.
#pragma warning(disable : 4786)
// To really remove *all* of the warnings, we have to employ the following,
// obscure workaround from https://www.earthli.com/news/view_article.php?id=376
static class msVC6_4786WorkAround {
public:
msVC6_4786WorkAround() {}
} msVC6_4786WorkAround;
#define MSVC420_VERSION 1020

3
compile.cmd Normal file
View File

@ -0,0 +1,3 @@
@echo off
%* | findstr /v /b "warning C4786"