You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Normally, CMake defaults the C compiler flags to the value of CFLAGS environment variable. However, c-blosc2 overrides CMAKE_C_FLAGS and prevents CMake from respecting that.
Indeed CGLAGS seems to be the traditional standard approach to modify C options locally outside the build chain, but also inside the build chain. For example, in configure.ac you would write:
CFLAGS="$CFLAGS -std=c11"
Therefore, I wonder whether CMake should manipulate CFLAGS instead of directly modifying CMAKE_C_FLAGS:
CMake uses this environment variable value, in combination with its own builtin default flags for the toolchain, to initialize and store the CMAKE_C_FLAGS cache entry. [...] For any configuration run (including the first), the environment variable will be ignored if the CMAKE_C_FLAGS variable is already defined.
However, that approach might require some extra changes, for example here:
# Set the "-msse2" build flag only if the CMAKE_C_FLAGS is not already set.# Probably "-msse2" should be appended to CMAKE_C_FLAGS_RELEASE.if(CMAKE_C_COMPILER_ID STREQUAL GNU OR CMAKE_C_COMPILER_ID STREQUAL Clang OR CMAKE_C_COMPILER_ID STREQUAL Intel)
if(NOT CMAKE_C_FLAGS AND COMPILER_SUPPORT_SSE2)
set(CMAKE_C_FLAGS -msse2 CACHESTRING"C flags." FORCE)
endif()
endif()
Describe the bug
Normally, CMake defaults the C compiler flags to the value of
CFLAGS
environment variable. However, c-blosc2 overridesCMAKE_C_FLAGS
and prevents CMake from respecting that.To Reproduce
Expected behavior
-frecord-gcc-switches
should be found on the compiler command-line.Logs
n/a
System information:
Additional context
I suppose adding something like this on top would work. However, I'm not sure if there isn't a cleaner solution:
The text was updated successfully, but these errors were encountered: