Skip to content

Commit

Permalink
gn: Add _GNU_SOURCE definition to Linux builds
Browse files Browse the repository at this point in the history
On GN-based linux-x64 builds, with the _GNU_SOURCE definition, the
compiler will now have readlink() and strtok_r() declared.

This is consistent to the build configurations defined in
loader/CMakeLists.txt.

Change-Id: If39f3b375e77fa1d0a9068123d04e516e166716a
  • Loading branch information
gnoliyil authored and charles-lunarg committed Feb 21, 2025
1 parent 712b1d2 commit bb1863b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ config("vulkan_loader_config") {
cflags = [ "/wd4201" ]
}
if (is_linux || is_chromeos) {
# assume secure_getenv() is available
defines += [
# Enables `readlink()` and `strtok_r()`.
"_GNU_SOURCE",

# assume secure_getenv() is available
"HAVE_SECURE_GETENV",
"LOADER_ENABLE_LINUX_SORT",
]
Expand Down

0 comments on commit bb1863b

Please sign in to comment.