git.s-ol.nu forks/DiligentCore / efd936c
Fixed MSVC compiler warnings + treat warnings as errors; made Diligent-BuildSettings private dependency for all projects assiduous 2 years ago
17 changed file(s) with 39 addition(s) and 30 deletion(s). Raw diff Collapse all Expand all
200200
201201
202202 if(MSVC)
203 # For msvc, enable level 4 warnings except for
203 # For msvc, enable level 4 warnings and treat warnings as errors, except for
204204 # - w4100 - unreferenced formal parameter
205205 # - w4505 - unreferenced local function has been removed
206206 # - w4201 - nonstandard extension used: nameless struct/union
207 target_compile_options(Diligent-BuildSettings INTERFACE /W4 /wd4100 /wd4505 /wd4201)
207 target_compile_options(Diligent-BuildSettings INTERFACE /W4 /WX /wd4100 /wd4505 /wd4201)
208208 # In all release modes also:
209209 # - disable w4189 - local variable is initialized but not referenced
210210 # - Disable RTTI (/GR-)
5252 )
5353
5454 target_link_libraries(Diligent-Common
55 PRIVATE
56 Diligent-BuildSettings
5557 PUBLIC
56 Diligent-BuildSettings
5758 Diligent-TargetPlatform
5859 )
5960 set_common_target_properties(Diligent-Common)
2626 )
2727
2828 target_link_libraries(Diligent-GraphicsAccessories
29 PRIVATE
30 Diligent-BuildSettings
2931 PUBLIC
30 Diligent-BuildSettings
3132 Diligent-Common
3233 Diligent-GraphicsEngineInterface
3334 )
7474 )
7575
7676 target_link_libraries(Diligent-GraphicsEngine
77 PRIVATE
78 Diligent-BuildSettings
7779 PUBLIC
78 Diligent-BuildSettings
7980 Diligent-PlatformInterface
8081 Diligent-Common
8182 Diligent-GraphicsAccessories
110110
111111 target_link_libraries(Diligent-GraphicsEngineD3D11-static
112112 PRIVATE
113 Diligent-BuildSettings
114 Diligent-GraphicsEngineD3DBase
113 Diligent-BuildSettings
114 Diligent-GraphicsEngineD3DBase
115115 Diligent-TargetPlatform
116116 Diligent-Common
117117 dxgi.lib
118 d3d11.lib
118 d3d11.lib
119119 d3dcompiler.lib
120120 PUBLIC
121121 Diligent-GraphicsEngineD3D11Interface
5959 )
6060
6161 target_link_libraries(Diligent-GraphicsEngineD3DBase
62 PRIVATE
63 Diligent-BuildSettings
6264 PUBLIC
63 Diligent-BuildSettings
6465 Diligent-GraphicsEngine
6566 Diligent-GraphicsEngineD3DBaseInterface
6667 )
2020 )
2121
2222 target_link_libraries(Diligent-GraphicsEngineNextGenBase
23 PRIVATE
24 Diligent-BuildSettings
2325 PUBLIC
24 Diligent-BuildSettings
2526 Diligent-PlatformInterface
2627 Diligent-Common
2728 Diligent-GraphicsAccessories
158158
159159
160160 set(PRIVATE_DEPENDENCIES
161 Diligent-BuildSettings
162 Diligent-Common
161 Diligent-BuildSettings
162 Diligent-Common
163163 Diligent-TargetPlatform
164164 Diligent-GraphicsEngine
165165 Diligent-GLSLTools
5959 SamplerCI.mipLodBias = m_Desc.MipLODBias;
6060 SamplerCI.anisotropyEnable = IsAnisotropicFilter(m_Desc.MinFilter);
6161 #ifdef DILIGENT_DEVELOPMENT
62 if (SamplerCI.anisotropyEnable != IsAnisotropicFilter(m_Desc.MagFilter))
62 if ((SamplerCI.anisotropyEnable != VK_FALSE) != IsAnisotropicFilter(m_Desc.MagFilter))
6363 {
6464 LOG_ERROR("Min and mag filters must both be either anisotropic filters or non-anisotropic ones");
6565 }
6868 SamplerCI.maxAnisotropy = static_cast<float>(m_Desc.MaxAnisotropy);
6969 SamplerCI.compareEnable = IsComparisonFilter(m_Desc.MinFilter);
7070 #ifdef DILIGENT_DEVELOPMENT
71 if (SamplerCI.compareEnable != IsComparisonFilter(m_Desc.MagFilter))
71 if ((SamplerCI.compareEnable != VK_FALSE) != IsComparisonFilter(m_Desc.MagFilter))
7272 {
7373 LOG_ERROR("Min and mag filters must both be either comparison filters or non-comparison ones");
7474 }
2626 PRIVATE
2727 log
2828 android
29 Diligent-BuildSettings
2930 PUBLIC
30 Diligent-BuildSettings
3131 Diligent-PlatformInterface
3232 Diligent-BasicPlatform
3333 )
3131 )
3232
3333 target_link_libraries(Diligent-ApplePlatform
34 PRIVATE
35 Diligent-BuildSettings
3436 PUBLIC
35 Diligent-BuildSettings
3637 Diligent-BasicPlatform
3738 Diligent-PlatformInterface
3839 )
2828 )
2929
3030 target_link_libraries(Diligent-BasicPlatform
31 PRIVATE
32 Diligent-BuildSettings
3133 PUBLIC
32 Diligent-BuildSettings
3334 Diligent-Primitives
3435 )
3536
2323 )
2424
2525 target_link_libraries(Diligent-LinuxPlatform
26 PRIVATE
27 Diligent-BuildSettings
2628 PUBLIC
27 Diligent-BuildSettings
2829 Diligent-BasicPlatform
2930 Diligent-PlatformInterface
3031 )
2525 )
2626
2727 target_link_libraries(Diligent-UniversalWindowsPlatform
28 PRIVATE
29 Diligent-BuildSettings
2830 PUBLIC
29 Diligent-BuildSettings
3031 Diligent-BasicPlatform
3132 Diligent-PlatformInterface
3233 )
2626
2727 target_link_libraries(Diligent-Win32Platform
2828 PUBLIC
29 Diligent-BuildSettings
3029 Diligent-BasicPlatform
3130 Diligent-PlatformInterface
3231 PRIVATE
32 Diligent-BuildSettings
3333 Shlwapi.lib
3434 )
3535
3131 set_common_target_properties(Diligent-Primitives)
3232
3333 target_link_libraries(Diligent-Primitives
34 PUBLIC
34 PRIVATE
3535 Diligent-BuildSettings
3636 )
3737
786786 TEST(Common_BasicMath, Hash)
787787 {
788788 {
789 EXPECT_NE(std::hash<float2>{}(float2{1, 2}), 0);
790 EXPECT_NE(std::hash<float3>{}(float3{1, 2, 3}), 0);
791 EXPECT_NE(std::hash<float4>{}(float4{1, 2, 3, 5}), 0);
789 EXPECT_NE(std::hash<float2>{}(float2{1, 2}), size_t{0});
790 EXPECT_NE(std::hash<float3>{}(float3{1, 2, 3}), size_t{0});
791 EXPECT_NE(std::hash<float4>{}(float4{1, 2, 3, 5}), size_t{0});
792792 // clang-format off
793793 float4x4 m1
794794 {
798798 13, 14, 15, 16
799799 };
800800 // clang-format on
801 EXPECT_NE(std::hash<float4x4>{}(m1), 0);
801 EXPECT_NE(std::hash<float4x4>{}(m1), size_t{0});
802802
803803 // clang-format off
804804 float3x3 m2
808808 9, 10, 11
809809 };
810810 // clang-format on
811 EXPECT_NE(std::hash<float3x3>{}(m2), 0);
811 EXPECT_NE(std::hash<float3x3>{}(m2), size_t{0});
812812
813813 // clang-format off
814814 float2x2 m3
817817 5, 6
818818 };
819819 // clang-format on
820 EXPECT_NE(std::hash<float2x2>{}(m3), 0);
820 EXPECT_NE(std::hash<float2x2>{}(m3), size_t{0});
821821 }
822822 }
823823
945945 TEST(Common_AdvancedMath, Planes)
946946 {
947947 Plane3D plane = {};
948 EXPECT_NE(std::hash<Plane3D>{}(plane), 0);
948 EXPECT_NE(std::hash<Plane3D>{}(plane), size_t{0});
949949
950950 ViewFrustum frustum = {};
951 EXPECT_NE(std::hash<ViewFrustum>{}(frustum), 0);
951 EXPECT_NE(std::hash<ViewFrustum>{}(frustum), size_t{0});
952952
953953 ViewFrustumExt frustm_ext = {};
954 EXPECT_NE(std::hash<ViewFrustumExt>{}(frustm_ext), 0);
954 EXPECT_NE(std::hash<ViewFrustumExt>{}(frustm_ext), size_t{0});
955955 }
956956
957957 TEST(Common_AdvancedMath, HermiteSpline)