From da642181a9bdf75854a9b19461580595ac8a04e6 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Thu, 30 Dec 2021 12:54:58 +0100 Subject: [PATCH] CMakeLists: unconditionally define _GNU_SOURCE This fixes compilation on musl libc. Link: https://github.com/linux-can/can-utils/pull/326 Reported-by: Rosen Penev Signed-off-by: Marc Kleine-Budde --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc13c37..fea4171 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,10 +9,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -check_symbol_exists(__GNU_LIBRARY__ "features.h" _GNU_SOURCE) -if(_GNU_SOURCE) - add_definitions(-D_GNU_SOURCE) -endif() +add_definitions(-D_GNU_SOURCE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-parentheses") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing")