Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions cli/cli.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
Expand All @@ -175,7 +175,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>$(TargetDir)cli.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
<LargeAddressAware>true</LargeAddressAware>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
Expand Down Expand Up @@ -214,7 +214,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4018;4127;4146;4244;4251;4267;4389;4482;4512;4701;4706;4800;4805</DisableSpecificWarnings>
Expand All @@ -231,6 +231,7 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-PCRE|x64'">
Expand All @@ -256,14 +257,15 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand All @@ -277,11 +279,12 @@
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
Expand Down Expand Up @@ -311,11 +314,12 @@
<AdditionalOptions>/Zc:throwingNew /Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<LanguageStandard>stdcpp14</LanguageStandard>
<FunctionLevelLinking>true</FunctionLevelLinking>
</ClCompile>
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
Expand All @@ -331,7 +335,7 @@
<AdditionalIncludeDirectories>..\lib;..\externals;..\externals\simplecpp;..\externals\tinyxml2;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BufferSecurityCheck>false</BufferSecurityCheck>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CPPCHECKLIB_IMPORT;TINYXML2_IMPORT;NDEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;WIN32_LEAN_AND_MEAN;_WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level4</WarningLevel>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
Expand All @@ -358,6 +362,7 @@
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-PCRE|x64'">
Expand All @@ -384,14 +389,15 @@
<Link>
<AdditionalDependencies>shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>../externals;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>false</GenerateDebugInformation>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>true</SetChecksum>
<StackReserveSize>8000000</StackReserveSize>
<StackCommitSize>8000000</StackCommitSize>
<LargeAddressAware>true</LargeAddressAware>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions cmake/compilerDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
70 changes: 67 additions & 3 deletions cmake/compileroptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

Expand Down
Loading