diff --git a/CMakeLists.txt b/CMakeLists.txt index f6ff00b0..50ac00e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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$<$:d>") target_compile_options(lego1 PRIVATE "/MT$<$:d>") diff --git a/LEGO1/compat.h b/LEGO1/compat.h index d9cc2170..9616b254 100644 --- a/LEGO1/compat.h +++ b/LEGO1/compat.h @@ -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 diff --git a/compile.cmd b/compile.cmd new file mode 100644 index 00000000..381126ab --- /dev/null +++ b/compile.cmd @@ -0,0 +1,3 @@ +@echo off + +%* | findstr /v /b "warning C4786"