-
Notifications
You must be signed in to change notification settings - Fork 173
Update bin2h.cmake to avoid -Werror=missing-braces #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
else() | ||
target_link_libraries(kompute PUBLIC Vulkan::Vulkan | ||
kp_logger | ||
kp_shader | ||
fmt::fmt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being removed?
@@ -94,7 +92,7 @@ add_subdirectory(shaders) | |||
add_subdirectory(include) | |||
|
|||
if(KOMPUTE_OPT_INSTALL) | |||
if (KOMPUTE_OPT_USE_BUILT_IN_FMT) | |||
if (NOT KOMPUTE_OPT_USE_SPDLOG AND KOMPUTE_OPT_USE_BUILT_IN_FMT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the need for the extra guard check?
@@ -95,12 +95,12 @@ function(BIN2H) | |||
set(namespaceStart "namespace ${HEADER_NAMESPACE} {") | |||
set(namespaceEnd "} // namespace ${HEADER_NAMESPACE}") | |||
set(arrayIncludes "#pragma once\n#include <array>\n#include <cstdint>") | |||
set(arrayDefinition "const std::array<uint32_t, ${arraySize}> ${BIN2H_VARIABLE_NAME} = { ${arrayValues} };") | |||
set(arrayDefinition "const std::array<uint32_t, ${arraySize}> ${BIN2H_VARIABLE_NAME} = { { ${arrayValues} } };") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work for both spdlog and fmt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution, just getting around - would you be able to provide more context on the comments? + also re-commit with the DCO
The header files generated by
bin2h.cmake
cause an error when the GCC flag-Werror=missing-braces
is enabled. I fixed this by adding another set of braces around${arrayValues}
on Line 98.Edit: I pushed some more changes to my fork which automatically got included in this PR. My new changes make use of FMT in SPDLOG instead of the system-installed version.