From 13a02a622c11df783ccf155d62f61dc0c6d6a5b2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 13 May 2023 13:40:33 +0200 Subject: cmake: document _GNU_SOURCE usage --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9758c2e..9174061 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,6 +4,9 @@ else() add_compile_options(-std=c17 -Wpedantic -Wall -Wextra -Werror) endif() +# Even w/ _POSIX_C_SOURCE=200809L, we still need accept4, pipe2, execvpe, etc., +# which are all _GNU_SOURCE-only (at least for glibc). Try compiling without +# any features macros defined at all, and prepare to be amazed! add_compile_definitions(_GNU_SOURCE) add_compile_definitions(VERSION="${PROJECT_VERSION}") -- cgit v1.2.3