Browse Source

Fix the Windows build and some MSVC warnings

Panagiotis Christopoulos Charitos 3 years ago
parent
commit
e2c2142b28

+ 11 - 10
AnKi/Gr/Vulkan/ShaderProgramImpl.cpp

@@ -163,11 +163,11 @@ Error ShaderProgramImpl::init(const ShaderProgramInitInfo& inf)
 	//
 	for(U32 set = 0; set < descriptorSetCount; ++set)
 	{
-		DescriptorSetLayoutInitInfo inf;
-		inf.m_bindings = WeakArray<DescriptorBinding>((counts[set]) ? &bindings[set][0] : nullptr, counts[set]);
+		DescriptorSetLayoutInitInfo dsinf;
+		dsinf.m_bindings = WeakArray<DescriptorBinding>((counts[set]) ? &bindings[set][0] : nullptr, counts[set]);
 
 		ANKI_CHECK(
-			getGrManagerImpl().getDescriptorSetFactory().newDescriptorSetLayout(inf, m_descriptorSetLayouts[set]));
+			getGrManagerImpl().getDescriptorSetFactory().newDescriptorSetLayout(dsinf, m_descriptorSetLayouts[set]));
 
 		// Even if the dslayout is empty we will have to list it because we'll have to bind a DS for it.
 		m_refl.m_descriptorSetMask.set(set);
@@ -206,13 +206,14 @@ Error ShaderProgramImpl::init(const ShaderProgramInitInfo& inf)
 		{
 			const ShaderImpl& shaderImpl = static_cast<const ShaderImpl&>(*shader);
 
-			VkPipelineShaderStageCreateInfo& inf = m_graphics.m_shaderCreateInfos[m_graphics.m_shaderCreateInfoCount++];
-			inf = {};
-			inf.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
-			inf.stage = VkShaderStageFlagBits(convertShaderTypeBit(ShaderTypeBit(1 << shader->getShaderType())));
-			inf.pName = "main";
-			inf.module = shaderImpl.m_handle;
-			inf.pSpecializationInfo = shaderImpl.getSpecConstInfo();
+			VkPipelineShaderStageCreateInfo& createInf =
+				m_graphics.m_shaderCreateInfos[m_graphics.m_shaderCreateInfoCount++];
+			createInf = {};
+			createInf.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
+			createInf.stage = VkShaderStageFlagBits(convertShaderTypeBit(ShaderTypeBit(1 << shader->getShaderType())));
+			createInf.pName = "main";
+			createInf.module = shaderImpl.m_handle;
+			createInf.pSpecializationInfo = shaderImpl.getSpecConstInfo();
 		}
 	}
 

+ 5 - 0
AnKi/Renderer/DepthDownscale.cpp

@@ -12,12 +12,17 @@
 #	pragma GCC diagnostic push
 #	pragma GCC diagnostic ignored "-Wunused-function"
 #	pragma GCC diagnostic ignored "-Wignored-qualifiers"
+#elif ANKI_COMPILER_MSVC
+#	pragma warning(push)
+#	pragma warning(disable : 4505)
 #endif
 #define A_CPU
 #include <ThirdParty/FidelityFX/ffx_a.h>
 #include <ThirdParty/FidelityFX/ffx_spd.h>
 #if ANKI_COMPILER_GCC_COMPATIBLE
 #	pragma GCC diagnostic pop
+#elif ANKI_COMPILER_MSVC
+#	pragma warning(pop)
 #endif
 
 namespace anki {

+ 5 - 0
AnKi/Renderer/Scale.cpp

@@ -12,12 +12,17 @@
 #	pragma GCC diagnostic push
 #	pragma GCC diagnostic ignored "-Wunused-function"
 #	pragma GCC diagnostic ignored "-Wignored-qualifiers"
+#elif ANKI_COMPILER_MSVC
+#	pragma warning(push)
+#	pragma warning(disable : 4505)
 #endif
 #define A_CPU
 #include <ThirdParty/FidelityFX/ffx_a.h>
 #include <ThirdParty/FidelityFX/ffx_fsr1.h>
 #if ANKI_COMPILER_GCC_COMPATIBLE
 #	pragma GCC diagnostic pop
+#elif ANKI_COMPILER_MSVC
+#	pragma warning(pop)
 #endif
 
 namespace anki {

+ 1 - 1
AnKi/Ui/ImGuiConfig.h

@@ -6,7 +6,7 @@
 #pragma once
 
 #include <AnKi/Util/Assert.h>
-#include <AnKi/Math.h>
+#include <AnKi/Math/Vec.h>
 
 #define IM_ASSERT(_EXPR) ANKI_ASSERT(_EXPR)
 

+ 3 - 4
AnKi/Util/File.cpp

@@ -349,7 +349,7 @@ Error File::write(const void* buff, PtrSize size)
 	return err;
 }
 
-Error File::writeText(CString format, ...)
+Error File::writeText(const Char* format, ...)
 {
 	ANKI_ASSERT(m_file);
 	ANKI_ASSERT(m_flags != FileOpenFlag::NONE);
@@ -369,7 +369,7 @@ Error File::writeText(CString format, ...)
 	else
 #endif
 	{
-		std::vfprintf(ANKI_CFILE, &format[0], args);
+		std::vfprintf(ANKI_CFILE, format, args);
 	}
 
 	va_end(args);
@@ -413,14 +413,13 @@ PtrSize File::tell()
 	if(!!(m_flags & FileOpenFlag::SPECIAL))
 	{
 		ANKI_ASSERT(0);
+		return 0;
 	}
 	else
 #endif
 	{
 		return ftell(ANKI_CFILE);
 	}
-
-	return 0;
 }
 
 FileOpenFlag File::getMachineEndianness()

+ 2 - 1
AnKi/Util/File.h

@@ -102,7 +102,8 @@ public:
 	Error write(const void* buff, PtrSize size);
 
 	/// Write formated text
-	Error writeText(CString format, ...);
+	ANKI_CHECK_FORMAT(1, 2)
+	Error writeText(const Char* format, ...);
 
 	/// Set the position indicator to a new position.
 	/// @param offset Number of bytes to offset from origin

+ 4 - 3
AnKi/Util/String.cpp

@@ -241,13 +241,14 @@ void String::appendInternal(Allocator& alloc, const Char* str, PtrSize strLen)
 	m_data = std::move(newData);
 }
 
-String& String::sprintf(Allocator alloc, CString fmt, ...)
+String& String::sprintf(Allocator alloc, const Char* fmt, ...)
 {
+	ANKI_ASSERT(fmt);
 	Array<Char, 512> buffer;
 	va_list args;
 
 	va_start(args, fmt);
-	[[maybe_unused]] I len = std::vsnprintf(&buffer[0], sizeof(buffer), &fmt[0], args);
+	I len = std::vsnprintf(&buffer[0], sizeof(buffer), fmt, args);
 	va_end(args);
 
 	if(len < 0)
@@ -260,7 +261,7 @@ String& String::sprintf(Allocator alloc, CString fmt, ...)
 		m_data.create(alloc, size);
 
 		va_start(args, fmt);
-		len = std::vsnprintf(&m_data[0], size, &fmt[0], args);
+		len = std::vsnprintf(&m_data[0], size, fmt, args);
 		va_end(args);
 
 		ANKI_ASSERT((len + 1) == size);

+ 4 - 2
AnKi/Util/String.h

@@ -451,7 +451,8 @@ public:
 	}
 
 	/// Create formated string.
-	String& sprintf(Allocator alloc, CString fmt, ...);
+	ANKI_CHECK_FORMAT(2, 3)
+	String& sprintf(Allocator alloc, const Char* fmt, ...);
 
 	/// Destroy the string.
 	void destroy(Allocator alloc)
@@ -811,7 +812,8 @@ public:
 
 	/// Create formated string.
 	template<typename... TArgs>
-	StringAuto& sprintf(CString fmt, TArgs... args)
+	ANKI_CHECK_FORMAT(1, 2)
+	StringAuto& sprintf(const Char* fmt, TArgs... args)
 	{
 		Base::sprintf(m_alloc, fmt, args...);
 		return *this;

+ 4 - 2
AnKi/Util/StringList.h

@@ -54,7 +54,8 @@ public:
 
 	/// Push at the end of the list a formated string.
 	template<typename... TArgs>
-	void pushBackSprintf(Allocator alloc, CString fmt, TArgs... args)
+	ANKI_CHECK_FORMAT(2, 3)
+	void pushBackSprintf(Allocator alloc, const Char* fmt, TArgs... args)
 	{
 		String str;
 		str.sprintf(alloc, fmt, args...);
@@ -139,7 +140,8 @@ public:
 
 	/// Push at the end of the list a formated string
 	template<typename... TArgs>
-	void pushBackSprintf(CString fmt, TArgs... args)
+	ANKI_CHECK_FORMAT(1, 2)
+	void pushBackSprintf(const Char* fmt, TArgs... args)
 	{
 		Base::pushBackSprintf(m_alloc, fmt, args...);
 	}

+ 1 - 0
AnKi/Util/Thread.h

@@ -479,6 +479,7 @@ public:
 		sem_init(&m_handle, 0, initialValue);
 #else
 		ANKI_ASSERT(!"TODO");
+		(void)initialValue;
 #endif
 	}
 

+ 9 - 2
CMakeLists.txt

@@ -429,8 +429,15 @@ if(NOT MSVC)
 
 	set(CMAKE_CXX_STANDARD 17)
 else()
-	#add_definitions("/wd4996 /wd4244 /wd4262 /wd4267 /wd26495 /wd26439")
-	add_compile_options("/std:c++17")
+	string(REPLACE "/W3" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+	add_compile_options(
+		/std:c++17
+		/W4
+		/wd4324
+		/wd4456
+		/wd4127
+		/wd4457)
 endif()
 
 # Add AnKi sub libraries

+ 17 - 0
Tests/Framework/Framework.h

@@ -229,4 +229,21 @@ GrManager* createGrManager(ConfigSet* cfg, NativeWindow* win);
 ResourceManager* createResourceManager(ConfigSet* cfg, GrManager* gr, PhysicsWorld*& physics,
 									   ResourceFilesystem*& resourceFs);
 
+/// Stolen from https://en.cppreference.com/w/cpp/algorithm/random_shuffle because std::random_suffle got deprecated
+template<class TRandomIt>
+static void randomShuffle(TRandomIt first, TRandomIt last)
+{
+	typename std::iterator_traits<TRandomIt>::difference_type i, n;
+	n = last - first;
+	for(i = n - 1; i > 0; --i)
+	{
+		using std::swap;
+		swap(first[i], first[std::rand() % (i + 1)]);
+		// rand() % (i+1) isn't actually correct, because the generated number
+		// is not uniformly distributed for most values of i. A correct implementation
+		// will need to essentially reimplement C++11 std::uniform_int_distribution,
+		// which is beyond the scope of this example.
+	}
+}
+
 } // end namespace anki

+ 2 - 4
Tests/Gr/Gr.cpp

@@ -18,7 +18,7 @@
 #include <AnKi/Collision/Aabb.h>
 #include <ctime>
 
-namespace anki {
+using namespace anki;
 
 const U WIDTH = 1024;
 const U HEIGHT = 768;
@@ -3050,7 +3050,7 @@ F32 scatteringPdfLambertian(Vec3 normal, Vec3 scatteredDir)
 #undef MAGIC_MACRO
 
 		StringAuto commonSrc(alloc);
-		commonSrc.sprintf(commonSrcPart, rtTypesStr.cstr());
+		commonSrc.sprintf(commonSrcPart.cstr(), rtTypesStr.cstr());
 
 		const CString lambertianSrc = R"(
 layout(location = PAYLOAD_LOCATION) rayPayloadInEXT PayLoad s_payLoad;
@@ -3643,5 +3643,3 @@ void main()
 
 	COMMON_END()
 }
-
-} // end namespace anki

+ 0 - 4
Tests/Gr/GrTextureBuffer.cpp

@@ -7,8 +7,6 @@
 #include <Tests/Gr/GrCommon.h>
 #include <AnKi/Gr.h>
 
-namespace anki {
-
 ANKI_TEST(Gr, TextureBuffer)
 {
 	ConfigSet cfg(allocAligned, nullptr);
@@ -80,5 +78,3 @@ void main()
 	GrManager::deleteInstance(gr);
 	NativeWindow::deleteInstance(win);
 }
-
-} // end namespace anki

+ 0 - 4
Tests/Renderer/TileAllocator.cpp

@@ -6,8 +6,6 @@
 #include <Tests/Framework/Framework.h>
 #include <AnKi/Renderer/TileAllocator.h>
 
-namespace anki {
-
 ANKI_TEST(Renderer, TileAllocator)
 {
 	HeapAllocator<U8> alloc(allocAligned, nullptr);
@@ -69,5 +67,3 @@ ANKI_TEST(Renderer, TileAllocator)
 		ANKI_TEST_EXPECT_EQ(res, TileAllocatorResult::ALLOCATION_SUCCEEDED);
 	}
 }
-
-} // end namespace anki

+ 5 - 3
Tests/Resource/AsyncLoader.cpp

@@ -9,7 +9,9 @@
 #include <AnKi/Util/Atomic.h>
 #include <AnKi/Util/Functions.h>
 
-namespace anki {
+using namespace anki;
+
+namespace {
 
 class Task : public AsyncLoaderTask
 {
@@ -96,6 +98,8 @@ public:
 	}
 };
 
+} // namespace
+
 ANKI_TEST(Resource, AsyncLoader)
 {
 	HeapAllocator<U8> alloc(allocAligned, nullptr);
@@ -268,5 +272,3 @@ ANKI_TEST(Resource, AsyncLoader)
 		ANKI_TEST_EXPECT_EQ(counter.load(), 10);
 	}
 }
-
-} // end namespace anki

+ 0 - 4
Tests/Resource/ResourceFilesystem.cpp

@@ -6,8 +6,6 @@
 #include <Tests/Framework/Framework.h>
 #include <AnKi/Resource/ResourceFilesystem.h>
 
-namespace anki {
-
 ANKI_TEST(Resource, ResourceFilesystem)
 {
 	printf("Test requires the Data dir\n");
@@ -33,5 +31,3 @@ ANKI_TEST(Resource, ResourceFilesystem)
 		ANKI_TEST_EXPECT_EQ(txt, "hell\n");
 	}
 }
-
-} // end namespace anki

+ 0 - 4
Tests/Resource/ResourceManager.cpp

@@ -8,8 +8,6 @@
 #include <AnKi/Resource/ResourceManager.h>
 #include <AnKi/Core/ConfigSet.h>
 
-namespace anki {
-
 ANKI_TEST(Resource, ResourceManager)
 {
 	// Create
@@ -84,5 +82,3 @@ ANKI_TEST(Resource, ResourceManager)
 	// Delete
 	alloc.deleteInstance(resources);
 }
-
-} // end namespace anki

+ 0 - 4
Tests/Scene/Octree.cpp

@@ -6,8 +6,6 @@
 #include <Tests/Framework/Framework.h>
 #include <AnKi/Scene/Octree.h>
 
-namespace anki {
-
 ANKI_TEST(Scene, Octree)
 {
 	HeapAllocator<U8> alloc(allocAligned, nullptr);
@@ -84,5 +82,3 @@ ANKI_TEST(Scene, Octree)
 	}
 #endif
 }
-
-} // end namespace anki

+ 12 - 12
Tests/Script/LuaBinder.cpp

@@ -7,7 +7,18 @@
 #include <AnKi/Script.h>
 #include <AnKi/Math.h>
 
-static const char* script = R"(
+ANKI_TEST(Script, LuaBinder)
+{
+	ScriptManager sm;
+
+	ANKI_TEST_EXPECT_NO_ERR(sm.init(allocAligned, nullptr));
+	Vec4 v4(2.0, 3.0, 4.0, 5.0);
+	Vec3 v3(1.1f, 2.2f, 3.3f);
+
+	sm.exposeVariable("v4", &v4);
+	sm.exposeVariable("v3", &v3);
+
+	static const char* script = R"(
 b = Vec4.new(0, 0, 0, 1.1)
 if math.abs(b:getW() - 1.1) > 0.00001 then
 	print(b:getW())
@@ -22,17 +33,6 @@ v4:copy(v4 * b)
 v3:setZ(0.1)
 )";
 
-ANKI_TEST(Script, LuaBinder)
-{
-	ScriptManager sm;
-
-	ANKI_TEST_EXPECT_NO_ERR(sm.init(allocAligned, nullptr));
-	Vec4 v4(2.0, 3.0, 4.0, 5.0);
-	Vec3 v3(1.1f, 2.2f, 3.3f);
-
-	sm.exposeVariable("v4", &v4);
-	sm.exposeVariable("v3", &v3);
-
 	ANKI_TEST_EXPECT_NO_ERR(sm.evalString(script));
 
 	ANKI_TEST_EXPECT_EQ(v4, Vec4(6, 12, 0, 5.5));

+ 2 - 2
Tests/ShaderCompiler/ShaderProgramCompiler.cpp

@@ -78,7 +78,7 @@ void main()
 	{
 		File file;
 		ANKI_TEST_EXPECT_NO_ERR(file.open("test.glslp", FileOpenFlag::WRITE));
-		ANKI_TEST_EXPECT_NO_ERR(file.writeText(sourceCode));
+		ANKI_TEST_EXPECT_NO_ERR(file.writeText("%s", sourceCode.cstr()));
 	}
 
 	class Fsystem : public ShaderProgramFilesystemInterface
@@ -275,7 +275,7 @@ void main()
 	{
 		File file;
 		ANKI_TEST_EXPECT_NO_ERR(file.open("test.glslp", FileOpenFlag::WRITE));
-		ANKI_TEST_EXPECT_NO_ERR(file.writeText(sourceCode));
+		ANKI_TEST_EXPECT_NO_ERR(file.writeText("%s", sourceCode.cstr()));
 	}
 
 	class Fsystem : public ShaderProgramFilesystemInterface

+ 5 - 3
Tests/Ui/Ui.cpp

@@ -10,7 +10,9 @@
 #include <AnKi/Input.h>
 #include <AnKi/Core/GpuMemoryPools.h>
 
-namespace anki {
+using namespace anki;
+
+namespace {
 
 class Label : public UiImmediateModeBuilder
 {
@@ -51,6 +53,8 @@ public:
 	}
 };
 
+} // namespace
+
 ANKI_TEST(Ui, Ui)
 {
 	ConfigSet cfg;
@@ -154,5 +158,3 @@ ANKI_TEST(Ui, Ui)
 	Input::deleteInstance(in);
 	NativeWindow::deleteInstance(win);
 }
-
-} // end namespace anki

+ 1 - 3
Tests/Util/BuddyAllocatorBuilder.cpp

@@ -7,7 +7,7 @@
 #include <AnKi/Util/BuddyAllocatorBuilder.h>
 #include <tuple>
 
-namespace anki {
+using namespace anki;
 
 /// Check if all memory has the same value.
 static int memvcmp(const void* memory, U8 val, PtrSize size)
@@ -107,5 +107,3 @@ ANKI_TEST(Util, BuddyAllocatorBuilder)
 		}
 	}
 }
-
-} // end namespace anki

+ 1 - 3
Tests/Util/ClassAllocatorBuilder.cpp

@@ -11,7 +11,7 @@
 #include <random>
 #include <algorithm>
 
-namespace anki {
+using namespace anki;
 
 namespace {
 
@@ -216,5 +216,3 @@ ANKI_TEST(Util, ClassAllocatorBuilder)
 		allocations.clear();
 	}
 }
-
-} // end namespace anki

+ 1 - 1
Tests/Util/HashMap.cpp

@@ -222,7 +222,7 @@ ANKI_TEST(Util, HashMap)
 		// Delete
 		{
 			// Remove in random order
-			std::random_shuffle(vals.begin(), vals.end());
+			randomShuffle(vals.begin(), vals.end());
 
 			// Random delete AnKi
 			Second akTime = 0.0;

+ 2 - 2
Tests/Util/SparseArray.cpp

@@ -377,7 +377,7 @@ ANKI_TEST(Util, SparseArrayBench)
 	// Search
 	{
 		// Search in random order
-		std::random_shuffle(vals.begin(), vals.end());
+		randomShuffle(vals.begin(), vals.end());
 
 		int count = 0;
 
@@ -413,7 +413,7 @@ ANKI_TEST(Util, SparseArrayBench)
 	// Deletes
 	{
 		// Remove in random order
-		std::random_shuffle(vals.begin(), vals.end());
+		randomShuffle(vals.begin(), vals.end());
 
 		// Random delete AnKi
 		Second akTime = 0.0;

+ 0 - 4
Tests/Util/String.cpp

@@ -7,8 +7,6 @@
 #include <AnKi/Util/String.h>
 #include <string>
 
-namespace anki {
-
 ANKI_TEST(Util, String)
 {
 	HeapAllocator<U8> alloc(allocAligned, nullptr);
@@ -230,5 +228,3 @@ ANKI_TEST(Util, String)
 		a.destroy(alloc);
 	}
 }
-
-} // end namespace anki

+ 0 - 4
Tests/Util/StringList.cpp

@@ -6,8 +6,6 @@
 #include <Tests/Framework/Framework.h>
 #include <AnKi/Util/StringList.h>
 
-namespace anki {
-
 ANKI_TEST(Util, StringList)
 {
 	HeapAllocator<U8> alloc(allocAligned, nullptr);
@@ -37,5 +35,3 @@ ANKI_TEST(Util, StringList)
 		ANKI_TEST_EXPECT_EQ(*it, "boo");
 	}
 }
-
-} // end namespace anki

+ 0 - 4
Tests/Util/Thread.cpp

@@ -10,8 +10,6 @@
 #include <AnKi/Util/ThreadPool.h>
 #include <cstring>
 
-namespace anki {
-
 ANKI_TEST(Util, Thread)
 {
 	static const char* THREAD_NAME = "name";
@@ -115,8 +113,6 @@ struct TestJobTP : ThreadPoolTask
 	}
 };
 
-} // end namespace anki
-
 ANKI_TEST(Util, ThreadPool)
 {
 	const U32 threadsCount = 4;

+ 9 - 3
Tests/Util/ThreadHive.cpp

@@ -8,7 +8,9 @@
 #include <AnKi/Util/HighRezTimer.h>
 #include <AnKi/Util/System.h>
 
-namespace anki {
+using namespace anki;
+
+namespace {
 
 class ThreadHiveTestContext
 {
@@ -61,6 +63,8 @@ static void taskToWait(void* arg, [[maybe_unused]] U32 threadId, [[maybe_unused]
 	ANKI_TEST_EXPECT_GEQ(prev, 10);
 }
 
+} // namespace
+
 ANKI_TEST(Util, ThreadHive)
 {
 	const U32 threadCount = 32;
@@ -172,6 +176,8 @@ ANKI_TEST(Util, ThreadHive)
 	}
 }
 
+namespace {
+
 class FibTask
 {
 public:
@@ -225,6 +231,8 @@ static U64 fib(U64 n)
 	}
 }
 
+} // namespace
+
 ANKI_TEST(Util, ThreadHiveBench)
 {
 	static const U FIB_N = 32;
@@ -248,5 +256,3 @@ ANKI_TEST(Util, ThreadHiveBench)
 	ANKI_TEST_LOGI("Total time %fms. Ground truth %fms", (timeB - timeA) * 1000.0, (timeC - timeB) * 1000.0);
 	ANKI_TEST_EXPECT_EQ(sum.getNonAtomically(), serialFib);
 }
-
-} // end namespace anki

+ 3 - 3
ThirdParty/Bullet/CMakeLists.txt

@@ -71,7 +71,7 @@ ENDIF (CMAKE_SYSTEM_NAME STREQUAL WindowsPhone OR CMAKE_SYSTEM_NAME STREQUAL Win
 
 
 # Disable, MSVC workaround
-IF(MSVC AND FALSE)
+IF(MSVC)
 	IF (NOT USE_MSVC_INCREMENTAL_LINKING)
 		#MESSAGE("MSVC_INCREMENTAL_DEFAULT"+${MSVC_INCREMENTAL_DEFAULT})
 		SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:NO")
@@ -94,7 +94,7 @@ IF(MSVC AND FALSE)
 
 	ENDIF (NOT USE_MSVC_INCREMENTAL_LINKING)
 
-	IF (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
+	IF (NOT USE_MSVC_RUNTIME_LIBRARY_DLL AND FALSE)
 		#We statically link to reduce dependancies
 		FOREACH(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO )
 			IF(${flag_var} MATCHES "/MD")
@@ -104,7 +104,7 @@ IF(MSVC AND FALSE)
 				STRING(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}")
 			ENDIF(${flag_var} MATCHES "/MDd")
 		ENDFOREACH(flag_var)
-	ENDIF (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
+	ENDIF ()
 
 	IF (CMAKE_CL_64)
 	  ADD_DEFINITIONS(-D_WIN64)

+ 1 - 1
ThirdParty/Bullet/src/LinearMath/btAlignedObjectArray.h

@@ -40,7 +40,7 @@ subject to the following restrictions:
 #endif //BT_USE_PLACEMENT_NEW
 
 // The register keyword is deprecated in C++11 so don't use it.
-#if __cplusplus > 199711L
+#if 1 || __cplusplus > 199711L
 #define BT_REGISTER
 #else
 #define BT_REGISTER register

+ 3 - 1
ThirdParty/ImGui/CMakeLists.txt

@@ -5,7 +5,9 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../..)
 include_directories(${CMAKE_CURRENT_BINARY_DIR}/../..)
 if(NOT MSVC)
-	add_definitions("-std=c++14")
+	add_compile_options(-std=c++17)
+else()
+	add_compile_options(/std:c++17)
 endif()
 
 add_library(AnKiImGui ${SRC})