From ab32b4b4d08ffdcf1f364981898ed57d85e26aad Mon Sep 17 00:00:00 2001 From: Ihor Dutchak <> Date: Mon, 25 Dec 2023 19:45:18 +0200 Subject: [PATCH] Define _GNU_SOURCE in config.h Same way as libusb/autotools does it. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index db4ccee..7b2e459 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,9 @@ function(generate_config_file) endif() file(MAKE_DIRECTORY "${LIBUSB_GEN_INCLUDES}") + if(NOT MSVC) + set(_GNU_SOURCE TRUE) + endif() configure_file(config.h.in "${LIBUSB_GEN_INCLUDES}/config.h" @ONLY) endfunction()