Skip to content

[LLVM][Cygwin] Define _GNU_SOURCE on Cygwin as well. #138329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions llvm/cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ endif()
# Keep this at the top to make sure we don't add _GNU_SOURCE dependent checks
# before adding it.
check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
if(LLVM_USING_GLIBC)
if(LLVM_USING_GLIBC OR CYGWIN)
add_compile_definitions(_GNU_SOURCE)
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
endif()

# enable 64bit off_t on 32bit systems using glibc
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
add_compile_definitions(_FILE_OFFSET_BITS=64)
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
endif()
# enable 64bit off_t on 32bit systems using glibc
if(LLVM_USING_GLIBC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
add_compile_definitions(_FILE_OFFSET_BITS=64)
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
endif()

# include checks
Expand Down