diff --git a/cli/cli.vcxproj b/cli/cli.vcxproj index 613e4e61f..c242bad09 100644 --- a/cli/cli.vcxproj +++ b/cli/cli.vcxproj @@ -160,7 +160,7 @@ true ProgramDatabase Disabled - CPPCHECKLIB_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level4 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 @@ -175,7 +175,7 @@ true Console true - $(TargetDir)cli.pdb + $(OutDir)$(TargetName).pdb true 8000000 8000000 @@ -214,7 +214,7 @@ true ProgramDatabase Disabled - CPPCHECKLIB_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) + CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) MultiThreadedDebugDLL Level4 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 @@ -231,6 +231,7 @@ true 8000000 8000000 + true @@ -256,6 +257,7 @@ true 8000000 8000000 + true @@ -263,7 +265,7 @@ ..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) false MaxSpeed - CPPCHECKLIB_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) + CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) MultiThreadedDLL Level4 AnySuitable @@ -277,11 +279,12 @@ /Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions) true stdcpp14 + true shlwapi.lib;%(AdditionalDependencies) ../externals;%(AdditionalLibraryDirectories) - false + true Console true true @@ -311,11 +314,12 @@ /Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions) true stdcpp14 + true shlwapi.lib;%(AdditionalDependencies) ../externals;%(AdditionalLibraryDirectories) - false + true Console true true @@ -331,7 +335,7 @@ ..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) false MaxSpeed - CPPCHECKLIB_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) + CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) MultiThreadedDLL Level4 AnySuitable @@ -358,6 +362,7 @@ true 8000000 8000000 + true @@ -384,7 +389,7 @@ shlwapi.lib;%(AdditionalDependencies) ../externals;%(AdditionalLibraryDirectories) - false + true Console true true @@ -392,6 +397,7 @@ true 8000000 8000000 + true diff --git a/cmake/compilerDefinitions.cmake b/cmake/compilerDefinitions.cmake index 3ae139491..e7117fc0e 100644 --- a/cmake/compilerDefinitions.cmake +++ b/cmake/compilerDefinitions.cmake @@ -4,7 +4,12 @@ if (MSVC) add_definitions(-DDEBUG) endif() + #add_definitions(-DCPPCHECKLIB_IMPORT) + #add_definitions(-DTINYXML2_IMPORT) + add_definitions(-DWIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) + add_definitions(-DWIN32_LEAN_MEAN) + add_definitions(-D_WIN64) endif() # TODO: this should probably apply to the compiler and not the platform diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index 95ba5db5e..684c93ce0 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -101,7 +101,48 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() if (MSVC) - add_compile_options(/W4) + # General + add_compile_options(/W4) # Warning Level + add_compile_options(/Zi) # Debug Information Format - Program Database + if (WARNINGS_ARE_ERRORS) + add_compile_options(/WX) # Treat Warning As Errors + endif() + add_compile_options(/MP) # Multi-processor Compilation + + # Advanced + # Character Set - Use Unicode Character Set + # No Whole Program Optimization + + # C/C++ - Optimization + if(CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") + add_compile_options(/O2) # Optimization - Maximum Optimization (Favor Speed) + add_compile_options(/Ob2) # Inline Function Expansion - Any Suitable + add_compile_options(/Oi) # Enable Intrinsic Functions + add_compile_options(/Ot) # Favor fast code + add_compile_options(/Oy) # Omit Frame Pointers + else() + add_compile_options(/Od) # Optimization - Disabled + endif() + + # C/C++ - Code Generation + if(CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") + add_compile_options(/GF) # Enable String Pooling + add_compile_options(/MD) # Runtime Library - Multi-threaded DLL + add_compile_options(/GS-) # Disable Security Check + add_compile_options(/Gy) # Enable Function-Level Linking + else() + add_compile_options(/MDd) # Runtime Library - Multi-threaded Debug DLL + add_compile_options(/GS) # Enable Security Check + endif() + + # C/C++ - Language + add_compile_options(/Zc:rvalueCast) # Enforce type conversion rules + add_compile_options(/std:c++14) # C++ Langage Standard - ISO C++14 Standard + + # C/C++ - Browse Information + # Enable Browse Information - No + + # C/C++ - Advanced add_compile_options(/wd4018) # warning C4018: '>': signed/unsigned mismatch add_compile_options(/wd4127) # warning C4127: conditional expression is constant add_compile_options(/wd4146) # warning C4146: unary minus operator applied to unsigned type, result still unsigned @@ -117,8 +158,31 @@ if (MSVC) add_compile_options(/wd4800) # warning C4800: 'const SymbolDatabase *' : forcing value to bool 'true' or 'false' (performance warning) add_compile_options(/wd4805) # warning C4805: '==' : unsafe mix of type 'bool' and type 'long long' in operation - if (WARNINGS_ARE_ERRORS) - add_compile_options(/WX) + # C/C++ - All Options + add_compile_options(/Zc:throwingNew /Zc:__cplusplus) # Additional Options + + # Linker - General + if(CMAKE_BUILD_TYPE MATCHES "Debug") + add_link_options(/INCREMENTAL) # Enable Incremental Linking - Yes + endif() + add_link_options(/NOLOGO) # SUppress Startup Banner - Yes + # Ignore Import Library - Yes + + # Linker - Debugging + add_link_options(/DEBUG) # Generate Debug Information + + # Linker - System + # Stack Reserve Size - 8000000 + # Stack Commit Size - 8000000 + add_link_options(/LARGEADDRESSAWARE) # Enbale Large Addresses - Yes + + # Linker - Optimization + add_link_options(/OPT:REF) # References - Yes + add_link_options(/OPT:ICF) # Enable COMDAT Folding - Yes + + # Linker - Advanced + if(CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") + add_link_options(/RELEASE) # Set Checksum - Yes endif() endif() diff --git a/lib/cppcheck.vcxproj b/lib/cppcheck.vcxproj index 4029a01ef..28cc5b3ed 100644 --- a/lib/cppcheck.vcxproj +++ b/lib/cppcheck.vcxproj @@ -1,4 +1,4 @@ - + Debug-PCRE @@ -298,7 +298,7 @@ CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) Level4 ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) - 4018;4146;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 MultiThreadedDebugDLL Use precompiled.h @@ -311,13 +311,15 @@ ../externals;%(AdditionalLibraryDirectories) true true - false + + true 8000000 8000000 - xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y + xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -329,7 +331,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions) Level4 ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) - 4018;4146;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 MultiThreadedDebugDLL Use precompiled.h @@ -348,7 +350,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y 8000000 - xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y + xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -360,7 +363,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) Level4 ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) - 4018;4146;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 MultiThreadedDebugDLL Use precompiled.h @@ -375,9 +378,11 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true 8000000 8000000 + true - xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y + xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -389,7 +394,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) Level4 ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) - 4018;4146;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 MultiThreadedDebugDLL Use precompiled.h @@ -405,9 +410,11 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true 8000000 8000000 + true - xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y + xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -422,7 +429,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true true ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) - 4018;4146;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) MultiThreadedDLL ProgramDatabase @@ -437,7 +444,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y ../externals;%(AdditionalLibraryDirectories) - false + true true true true @@ -446,7 +453,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y 8000000 - xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y + xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -461,7 +469,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true true ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) - 4018;4146;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;TIXML_USE_STL;%(PreprocessorDefinitions) MultiThreadedDLL ProgramDatabase @@ -477,7 +485,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y pcre.lib;%(AdditionalDependencies) ../externals;%(AdditionalLibraryDirectories) - false + true true true true @@ -486,7 +494,8 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y 8000000 - xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y + xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -501,7 +510,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true true ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) - 4018;4146;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) MultiThreadedDLL ProgramDatabase @@ -522,9 +531,11 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true 8000000 8000000 + true - xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y + xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y @@ -539,7 +550,7 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y true true ..\externals;..\externals\picojson;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories) - 4018;4146;4127;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 + 4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805 CPPCHECKLIB_EXPORT;TINYXML2_EXPORT;SIMPLECPP_EXPORT;NDEBUG;WIN32;HAVE_RULES;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions) MultiThreadedDLL ProgramDatabase @@ -555,15 +566,17 @@ xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y pcre64.lib;%(AdditionalDependencies) ../externals;%(AdditionalLibraryDirectories) - false + true true true true 8000000 8000000 + true - xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y + xcopy "$(SolutionDir)addons" "$(OutDir)addons" /E /I /D /Y +xcopy "$(SolutionDir)cfg" "$(OutDir)cfg" /E /I /D /Y xcopy "$(SolutionDir)platforms" "$(OutDir)platforms" /E /I /D /Y diff --git a/test/testrunner.vcxproj b/test/testrunner.vcxproj index f21a542ae..10994701a 100755 --- a/test/testrunner.vcxproj +++ b/test/testrunner.vcxproj @@ -229,6 +229,7 @@ true 8000000 8000000 + true @@ -267,6 +268,7 @@ true 8000000 8000000 + true @@ -306,8 +308,9 @@ true 8000000 8000000 + true - + \ No newline at end of file