Provide a way to use _GNU_SOURCE everywhere
I have this at the top of my project
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
add_compile_definitions(_GNU_SOURCE)
I would consider the _GNU_SOURCE
as much as part of the definition of the system I want to target as CMAKE_C_EXTENSIONS
.
But then I find out check_c_source_compiles()
is not building with _GNU_SOURCE
, which makes my check behave surprisingly differently than my sources.
Could this be changed? I guess with some policy to be able to stay with the existing behaviour.
I guess the same applies to a bunch of other check_XXX()
functions.
I'm using cmake 3.17.4 right now, but I don't see anything in the 3.18 docs telling me this has changed.
Edited by Cristian Morales Vega