diff --git a/CMakeLists.txt b/CMakeLists.txt index 302d2f90e8..145f9e8c7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,10 +97,29 @@ if (MSVC) else() # Activate C++14 only on C++ files, not C files. list(APPEND NXT_FLAGS "$<$,CXX>:-std=c++14>") + # enable -Wold-style-cast on C++ + list(APPEND NXT_FLAGS "$<$,CXX>:-Wold-style-cast>") list(APPEND NXT_FLAGS "-fPIC") list(APPEND NXT_INTERNAL_FLAGS "-Wall" "-Wextra") + list(APPEND NXT_INTERNAL_FLAGS "-pedantic") list(APPEND NXT_GENERATED_FLAGS "-Wno-unused-variable" "-Wno-unused-function") + + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # don't break the build on older clang versions + list(APPEND NXT_INTERNAL_FLAGS "-Wno-error=unknown-warning-option") + # GCC's conversion warnings are less useful than clang's + list(APPEND NXT_INTERNAL_FLAGS "-Wconversion" "-Wno-sign-conversion") + # disable a clang-only -pedantic warning + list(APPEND NXT_INTERNAL_FLAGS "-Wno-gnu-zero-variadic-macro-arguments") + # additional potentially useful warnings (feel free to remove if they prove un-useful) + list(APPEND NXT_INTERNAL_FLAGS "-Wextra-semi") + list(APPEND NXT_INTERNAL_FLAGS "-Wstrict-aliasing") + list(APPEND NXT_INTERNAL_FLAGS "-Wunreachable-code") + list(APPEND NXT_GENERATED_FLAGS "-Wno-unreachable-code") + # Probably okay to enable if we establish a field naming convention: + #list(APPEND NXT_INTERNAL_FLAGS "-Wshadow") + endif() if(NXT_USE_WERROR) list(APPEND NXT_INTERNAL_FLAGS "-Werror") endif() diff --git a/examples/Animometer.cpp b/examples/Animometer.cpp index d770bdf146..71c5ef82cf 100644 --- a/examples/Animometer.cpp +++ b/examples/Animometer.cpp @@ -130,7 +130,7 @@ void frame() { size_t i = 0; std::vector commands(50); - for (int j = 0; j < 50; j++) { + for (size_t j = 0; j < 50; j++) { nxt::CommandBufferBuilder builder = device.CreateCommandBufferBuilder() .BeginRenderPass(renderpass, framebuffer) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index addb21c838..eda1db9a61 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -38,6 +38,9 @@ function(add_nxt_sample target sources) set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS "/wd4456") # declaration hides previous declaration -- for picojson set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS "/wd4706") + else() + # re-enable old style casts -- for GLM + set_property(TARGET ${target} APPEND PROPERTY COMPILE_OPTIONS "-Wno-old-style-cast") endif() endfunction() diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index cb8ab60732..c21ff2643b 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -81,7 +81,7 @@ void initBuffers() { } } - for (int i = 0; i < 2; i++) { + for (size_t i = 0; i < 2; i++) { particleBuffers[i] = device.CreateBufferBuilder() .SetAllowedUsage(nxt::BufferUsageBit::TransferDst | nxt::BufferUsageBit::Vertex | nxt::BufferUsageBit::Storage) .SetInitialUsage(nxt::BufferUsageBit::TransferDst) @@ -261,7 +261,7 @@ void initSim() { void initCommandBuffers() { static const uint32_t zeroOffsets[1] = {0}; - for (int i = 0; i < 2; ++i) { + for (size_t i = 0; i < 2; ++i) { auto& bufferSrc = particleBuffers[i]; auto& bufferDst = particleBuffers[(i + 1) % 2]; commandBuffers[i] = device.CreateCommandBufferBuilder() diff --git a/examples/HelloCompute.cpp b/examples/HelloCompute.cpp index 91b4c044bb..1ee27e24d4 100644 --- a/examples/HelloCompute.cpp +++ b/examples/HelloCompute.cpp @@ -35,7 +35,7 @@ void init() { queue = device.CreateQueueBuilder().GetResult(); struct {uint32_t a; float b;} s; - memset(&s, sizeof(s), 0); + memset(&s, 0, sizeof(s)); buffer = device.CreateBufferBuilder() .SetAllowedUsage(nxt::BufferUsageBit::TransferDst | nxt::BufferUsageBit::Uniform | nxt::BufferUsageBit::Storage) .SetInitialUsage(nxt::BufferUsageBit::TransferDst) diff --git a/examples/HelloTriangle.cpp b/examples/HelloTriangle.cpp index c5335b5dcb..d98bfb8d45 100644 --- a/examples/HelloTriangle.cpp +++ b/examples/HelloTriangle.cpp @@ -63,7 +63,7 @@ void initTextures() { // Initialize the texture with arbitrary data until we can load images std::vector data(4 * 1024 * 1024, 0); for (size_t i = 0; i < data.size(); ++i) { - data[i] = i % 253; + data[i] = static_cast(i % 253); } diff --git a/generator/main.py b/generator/main.py index 122661992f..d68f0b4056 100644 --- a/generator/main.py +++ b/generator/main.py @@ -225,7 +225,7 @@ class PreprocessingLoader(jinja2.BaseLoader): numstarts = (len(self.blockstart.split(line)) - 1) // 2 indentation_level += numstarts - return '\n'.join(result) + return '\n'.join(result) + '\n' def remove_indentation(self, line, n): for _ in range(n): diff --git a/generator/templates/apicpp_traits.h b/generator/templates/apicpp_traits.h index 5ce42046e8..e926562089 100644 --- a/generator/templates/apicpp_traits.h +++ b/generator/templates/apicpp_traits.h @@ -38,6 +38,6 @@ namespace nxt { template using Builder = typename BuiltObjectTrait::Builder; -}; +} #endif // NXTCPP_TRAITS_H diff --git a/generator/templates/wire/WireClient.cpp b/generator/templates/wire/WireClient.cpp index 4c46f3dc8e..acd1588681 100644 --- a/generator/templates/wire/WireClient.cpp +++ b/generator/templates/wire/WireClient.cpp @@ -180,7 +180,7 @@ namespace wire { } void FreeId(uint32_t id) { freeIds.push_back(id); - }; + } // 0 is an ID reserved to represent nullptr uint32_t currentId = 1; diff --git a/src/backend/CommandAllocator.cpp b/src/backend/CommandAllocator.cpp index e40af002b8..6ef87ad5d7 100644 --- a/src/backend/CommandAllocator.cpp +++ b/src/backend/CommandAllocator.cpp @@ -186,7 +186,8 @@ namespace backend { // Make sure we have space for current allocation, plus end of block and alignment padding // for the first id. - if (!GetNewBlock(nextPtr - currentPtr + sizeof(uint32_t) + alignof(uint32_t))) { + ASSERT(nextPtr > currentPtr); + if (!GetNewBlock(static_cast(nextPtr - currentPtr) + sizeof(uint32_t) + alignof(uint32_t))) { return nullptr; } return Allocate(commandId, commandSize, commandAlignment); diff --git a/src/backend/CommandBuffer.cpp b/src/backend/CommandBuffer.cpp index f6874746cc..407ca37506 100644 --- a/src/backend/CommandBuffer.cpp +++ b/src/backend/CommandBuffer.cpp @@ -88,7 +88,7 @@ namespace backend { } uint32_t ComputeDefaultRowPitch(TextureBase* texture, uint32_t width) { - uint32_t texelSize = static_cast(TextureFormatPixelSize(texture->GetFormat())); + uint32_t texelSize = TextureFormatPixelSize(texture->GetFormat()); return texelSize * width; } @@ -98,7 +98,7 @@ namespace backend { return false; } - uint32_t texelSize = static_cast(TextureFormatPixelSize(location.texture.Get()->GetFormat())); + uint32_t texelSize = TextureFormatPixelSize(location.texture.Get()->GetFormat()); if (rowPitch < location.width * texelSize) { builder->HandleError("Row pitch must not be less than the number of bytes per row"); return false; diff --git a/src/backend/CommandBufferStateTracker.cpp b/src/backend/CommandBufferStateTracker.cpp index 108a2a1dc6..51087fc871 100644 --- a/src/backend/CommandBufferStateTracker.cpp +++ b/src/backend/CommandBufferStateTracker.cpp @@ -200,7 +200,7 @@ namespace backend { aspects.set(VALIDATION_ASPECT_RENDER_SUBPASS); return true; - }; + } bool CommandBufferStateTracker::EndSubpass() { if (!aspects[VALIDATION_ASPECT_RENDER_SUBPASS]) { @@ -233,7 +233,7 @@ namespace backend { aspects.reset(VALIDATION_ASPECT_RENDER_SUBPASS); UnsetPipeline(); return true; - }; + } bool CommandBufferStateTracker::BeginRenderPass(RenderPassBase* renderPass, FramebufferBase* framebuffer) { if (aspects[VALIDATION_ASPECT_COMPUTE_PASS]) { @@ -402,7 +402,7 @@ namespace backend { } auto it = mostRecentBufferUsages.find(buffer); return it != mostRecentBufferUsages.end() && (it->second & usage); - }; + } bool CommandBufferStateTracker::TextureHasGuaranteedUsageBit(TextureBase* texture, nxt::TextureUsageBit usage) const { ASSERT(usage != nxt::TextureUsageBit::None && nxt::HasZeroOrOneBits(usage)); @@ -411,7 +411,7 @@ namespace backend { } auto it = mostRecentTextureUsages.find(texture); return it != mostRecentTextureUsages.end() && (it->second & usage); - }; + } bool CommandBufferStateTracker::IsInternalTextureTransitionPossible(TextureBase* texture, nxt::TextureUsageBit usage) const { ASSERT(usage != nxt::TextureUsageBit::None && nxt::HasZeroOrOneBits(usage)); @@ -419,7 +419,7 @@ namespace backend { return false; } return texture->IsTransitionPossible(usage); - }; + } bool CommandBufferStateTracker::IsExplicitTextureTransitionPossible(TextureBase* texture, nxt::TextureUsageBit usage) const { const nxt::TextureUsageBit attachmentUsages = @@ -519,7 +519,7 @@ namespace backend { } } return true; - }; + } bool CommandBufferStateTracker::RevalidateCanDraw() { if (!aspects[VALIDATION_ASPECT_RENDER_PIPELINE]) { diff --git a/src/backend/Pipeline.cpp b/src/backend/Pipeline.cpp index d16ef20f0f..3cab067d3f 100644 --- a/src/backend/Pipeline.cpp +++ b/src/backend/Pipeline.cpp @@ -36,7 +36,7 @@ namespace backend { info->mask = moduleInfo.mask; for (uint32_t i = 0; i < moduleInfo.names.size(); i++) { - unsigned int size = moduleInfo.sizes[i]; + uint32_t size = moduleInfo.sizes[i]; if (size == 0) { continue; } diff --git a/src/backend/ShaderModule.cpp b/src/backend/ShaderModule.cpp index dc52a95a4a..267baa4b46 100644 --- a/src/backend/ShaderModule.cpp +++ b/src/backend/ShaderModule.cpp @@ -96,7 +96,7 @@ namespace backend { // Fill in bindingInfo with the SPIRV bindings auto ExtractResourcesBinding = [this](const std::vector& resources, - const spirv_cross::Compiler& compiler, nxt::BindingType type) { + const spirv_cross::Compiler& compiler, nxt::BindingType bindingType) { constexpr uint64_t requiredBindingDecorationMask = (1ull << spv::DecorationBinding) | (1ull << spv::DecorationDescriptorSet); for (const auto& resource : resources) { @@ -113,7 +113,7 @@ namespace backend { info.used = true; info.id = resource.id; info.base_type_id = resource.base_type_id; - info.type = type; + info.type = bindingType; } }; diff --git a/src/backend/ShaderModule.h b/src/backend/ShaderModule.h index c13fc9a1f6..35e7412912 100644 --- a/src/backend/ShaderModule.h +++ b/src/backend/ShaderModule.h @@ -42,7 +42,7 @@ namespace backend { std::bitset mask; std::array names; - std::array sizes; + std::array sizes; std::array types; }; diff --git a/src/backend/Texture.cpp b/src/backend/Texture.cpp index b5bfcda267..bd6649d3a0 100644 --- a/src/backend/Texture.cpp +++ b/src/backend/Texture.cpp @@ -19,7 +19,7 @@ namespace backend { - size_t TextureFormatPixelSize(nxt::TextureFormat format) { + uint32_t TextureFormatPixelSize(nxt::TextureFormat format) { switch (format) { case nxt::TextureFormat::R8G8B8A8Unorm: return 4; diff --git a/src/backend/Texture.h b/src/backend/Texture.h index ab1a5d9f23..ca48e6d0df 100644 --- a/src/backend/Texture.h +++ b/src/backend/Texture.h @@ -23,7 +23,7 @@ namespace backend { - size_t TextureFormatPixelSize(nxt::TextureFormat format); + uint32_t TextureFormatPixelSize(nxt::TextureFormat format); bool TextureFormatHasDepth(nxt::TextureFormat format); bool TextureFormatHasStencil(nxt::TextureFormat format); diff --git a/src/backend/metal/InputStateMTL.mm b/src/backend/metal/InputStateMTL.mm index bbe75a838b..adc3826cf0 100644 --- a/src/backend/metal/InputStateMTL.mm +++ b/src/backend/metal/InputStateMTL.mm @@ -48,7 +48,7 @@ namespace metal { mtlVertexDescriptor = [MTLVertexDescriptor new]; const auto& attributesSetMask = GetAttributesSetMask(); - for (size_t i = 0; i < attributesSetMask.size(); ++i) { + for (uint32_t i = 0; i < attributesSetMask.size(); ++i) { if (!attributesSetMask[i]) { continue; } @@ -63,7 +63,7 @@ namespace metal { } const auto& inputsSetMask = GetInputsSetMask(); - for (size_t i = 0; i < inputsSetMask.size(); ++i) { + for (uint32_t i = 0; i < inputsSetMask.size(); ++i) { if (!inputsSetMask[i]) { continue; } diff --git a/src/backend/opengl/CommandBufferGL.cpp b/src/backend/opengl/CommandBufferGL.cpp index a736daf8dd..48be807e88 100644 --- a/src/backend/opengl/CommandBufferGL.cpp +++ b/src/backend/opengl/CommandBufferGL.cpp @@ -181,7 +181,7 @@ namespace opengl { glBindTexture(target, texture->GetHandle()); ASSERT(texture->GetDimension() == nxt::TextureDimension::e2D); - glPixelStorei(GL_UNPACK_ROW_LENGTH, copy->rowPitch / static_cast(TextureFormatPixelSize(texture->GetFormat()))); + glPixelStorei(GL_UNPACK_ROW_LENGTH, copy->rowPitch / TextureFormatPixelSize(texture->GetFormat())); glTexSubImage2D(target, dst.level, dst.x, dst.y, dst.width, dst.height, format.format, format.type, reinterpret_cast(static_cast(src.offset))); @@ -212,7 +212,7 @@ namespace opengl { texture->GetHandle(), src.level); glBindBuffer(GL_PIXEL_PACK_BUFFER, buffer->GetHandle()); - glPixelStorei(GL_PACK_ROW_LENGTH, copy->rowPitch / static_cast(TextureFormatPixelSize(texture->GetFormat()))); + glPixelStorei(GL_PACK_ROW_LENGTH, copy->rowPitch / TextureFormatPixelSize(texture->GetFormat())); ASSERT(src.depth == 1 && src.z == 0); void* offset = reinterpret_cast(static_cast(dst.offset)); glReadPixels(src.x, src.y, src.width, src.height, format.format, format.type, offset); diff --git a/src/backend/opengl/PipelineGL.cpp b/src/backend/opengl/PipelineGL.cpp index e029784903..9623f8ae46 100644 --- a/src/backend/opengl/PipelineGL.cpp +++ b/src/backend/opengl/PipelineGL.cpp @@ -192,12 +192,12 @@ namespace opengl { } const std::vector& PipelineGL::GetTextureUnitsForSampler(GLuint index) const { - ASSERT(index >= 0 && index < unitsForSamplers.size()); + ASSERT(index < unitsForSamplers.size()); return unitsForSamplers[index]; } const std::vector& PipelineGL::GetTextureUnitsForTexture(GLuint index) const { - ASSERT(index >= 0 && index < unitsForSamplers.size()); + ASSERT(index < unitsForSamplers.size()); return unitsForTextures[index]; } diff --git a/src/common/BitSetIterator.h b/src/common/BitSetIterator.h index 94e3abf2e6..48f0e171cd 100644 --- a/src/common/BitSetIterator.h +++ b/src/common/BitSetIterator.h @@ -112,7 +112,7 @@ unsigned long BitSetIterator::Iterator::getNextBit() { static std::bitset wordMask(std::numeric_limits::max()); while (mOffset < N) { - uint32_t wordBits = (mBits & wordMask).to_ulong(); + uint32_t wordBits = static_cast((mBits & wordMask).to_ulong()); if (wordBits != 0ul) { return ScanForward(wordBits) + mOffset; } diff --git a/src/common/Math.cpp b/src/common/Math.cpp index 5fc2a40705..1552c877ad 100644 --- a/src/common/Math.cpp +++ b/src/common/Math.cpp @@ -28,7 +28,7 @@ uint32_t ScanForward(uint32_t bits) { ASSERT(ret != 0); return firstBitIndex; #else - return static_cast(__builtin_ctz(bits)); + return static_cast(__builtin_ctz(bits)); #endif } @@ -40,7 +40,7 @@ uint32_t Log2(uint32_t value) { ASSERT(ret != 0); return firstBitIndex; #else - return 31 - __builtin_clz(value); + return 31 - static_cast(__builtin_clz(value)); #endif } @@ -52,13 +52,13 @@ bool IsPowerOfTwo(size_t n) { bool IsAligned(const void* ptr, size_t alignment) { ASSERT(IsPowerOfTwo(alignment)); ASSERT(alignment != 0); - return (reinterpret_cast(ptr) & (alignment - 1)) == 0; + return (reinterpret_cast(ptr) & (alignment - 1)) == 0; } void* AlignVoidPtr(void* ptr, size_t alignment) { ASSERT(IsPowerOfTwo(alignment)); ASSERT(alignment != 0); - return reinterpret_cast((reinterpret_cast(ptr) + (alignment - 1)) & ~(alignment - 1)); + return reinterpret_cast((reinterpret_cast(ptr) + (alignment - 1)) & ~(alignment - 1)); } uint32_t Align(uint32_t value, size_t alignment) { diff --git a/src/tests/unittests/CommandAllocatorTests.cpp b/src/tests/unittests/CommandAllocatorTests.cpp index 8c0bb27e8c..bc750d6216 100644 --- a/src/tests/unittests/CommandAllocatorTests.cpp +++ b/src/tests/unittests/CommandAllocatorTests.cpp @@ -203,7 +203,7 @@ TEST(CommandAllocator, LargeCommands) { const int kCommandCount = 5; - int count = 0; + uint32_t count = 0; for (int i = 0; i < kCommandCount; i++) { CommandBig* big = allocator.Allocate(CommandType::Big); for (int j = 0; j < kBigBufferSize; j++) { @@ -260,14 +260,15 @@ TEST(CommandAllocator, ManySmallCommands) { iterator.DataWasDestroyed(); } -// ________ -// / \ -// | POUIC! | -// \_ ______/ -// v -// ()_() -// (O.o) -// (> <)o +/* ________ + * / \ + * | POUIC! | + * \_ ______/ + * v + * ()_() + * (O.o) + * (> <)o + */ // Test usage of iterator.Reset TEST(CommandAllocator, IteratorReset) { diff --git a/src/tests/unittests/MathTests.cpp b/src/tests/unittests/MathTests.cpp index 6fd2093ca7..569d0311e8 100644 --- a/src/tests/unittests/MathTests.cpp +++ b/src/tests/unittests/MathTests.cpp @@ -64,7 +64,7 @@ TEST(Math, AlignPtr) { ASSERT_GE(aligned - unaligned, 0); ASSERT_LT(static_cast(aligned - unaligned), kTestAlignment); - ASSERT_EQ(reinterpret_cast(aligned) & (kTestAlignment -1), 0); + ASSERT_EQ(reinterpret_cast(aligned) & (kTestAlignment -1), 0); } } diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index a67615bc78..2dc1b66d9d 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -51,3 +51,7 @@ add_library(utils STATIC ${UTILS_SOURCES}) target_link_libraries(utils nxt_backend shaderc nxtcpp nxt) target_include_directories(utils PUBLIC ${SRC_DIR}) NXTInternalTarget("" utils) +if(NOT MSVC) + # allow C-style casts -- for shaderc + set_property(TARGET utils APPEND PROPERTY COMPILE_OPTIONS "-Wno-old-style-cast") +endif() diff --git a/src/utils/NXTHelpers.cpp b/src/utils/NXTHelpers.cpp index 12857bb146..7d5c9f9a6f 100644 --- a/src/utils/NXTHelpers.cpp +++ b/src/utils/NXTHelpers.cpp @@ -50,8 +50,13 @@ namespace utils { return; } - size_t size = (result.cend() - result.cbegin()); - builder.SetSource(static_cast(size), result.cbegin()); + // result.cend and result.cbegin return pointers to uint32_t. + const uint32_t* resultBegin = result.cbegin(); + const uint32_t* resultEnd = result.cend(); + // So this size is in units of sizeof(uint32_t). + ptrdiff_t resultSize = resultEnd - resultBegin; + // SetSource takes data as uint32_t*. + builder.SetSource(static_cast(resultSize), result.cbegin()); #ifdef DUMP_SPIRV_ASSEMBLY { diff --git a/src/utils/SystemUtils.cpp b/src/utils/SystemUtils.cpp index 049f107773..153810f742 100644 --- a/src/utils/SystemUtils.cpp +++ b/src/utils/SystemUtils.cpp @@ -25,11 +25,11 @@ namespace utils { #if defined(NXT_PLATFORM_WINDOWS) - void USleep(int usecs) { + void USleep(unsigned int usecs) { Sleep(static_cast(usecs / 1000)); } #elif defined(NXT_PLATFORM_POSIX) - void USleep(int usecs) { + void USleep(unsigned int usecs) { usleep(usecs); } #else diff --git a/src/utils/SystemUtils.h b/src/utils/SystemUtils.h index 88632fc516..d9df3f1a37 100644 --- a/src/utils/SystemUtils.h +++ b/src/utils/SystemUtils.h @@ -14,6 +14,6 @@ namespace utils { - void USleep(int usecs); + void USleep(unsigned int usecs); } diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 4b0ea3fb73..c283e7091d 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -25,7 +25,7 @@ set(GTEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest) set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/googlemock) add_library(gtest STATIC ${GTEST_DIR}/src/gtest-all.cc ${GMOCK_DIR}/src/gmock-all.cc) target_include_directories(gtest SYSTEM PUBLIC ${GTEST_DIR}/include ${GMOCK_DIR}/include) -target_include_directories(gtest PRIVATE ${GTEST_DIR} ${GMOCK_DIR}) +target_include_directories(gtest SYSTEM PRIVATE ${GTEST_DIR} ${GMOCK_DIR}) find_package(Threads) target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT}) NXTExternalTarget("third_party" gtest) @@ -36,7 +36,7 @@ add_library(glad STATIC ${CMAKE_CURRENT_SOURCE_DIR}/glad/include/glad/glad.h ${CMAKE_CURRENT_SOURCE_DIR}/glad/include/KHR/khrplatform.h ) -target_include_directories(glad PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/glad/include) +target_include_directories(glad SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/glad/include) NXTExternalTarget("third_party" glad) # ShaderC @@ -90,7 +90,7 @@ add_library(spirv_cross STATIC ${CMAKE_CURRENT_SOURCE_DIR}/spirv-cross/spirv_hlsl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/spirv-cross/spirv_hlsl.hpp ) -target_include_directories(spirv_cross PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(spirv_cross SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) NXTExternalTarget("third_party" spirv_cross) # STB, used for stb_image