Skip to content

Commit 676ba9a

Browse files
HarshithaKPcjihrig
authored andcommitted
src: suppress warnings in uvwasi.c (#70)
Define `_GNU_SOURCE` and `_POSIX_C_SOURCE` to suppress compilation warnings. Refs: nodejs/node#31139
1 parent 75b389c commit 676ba9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ if(APPLE)
1616
set(CMAKE_MACOSX_RPATH ON)
1717
endif()
1818

19+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
20+
list(APPEND uvwasi_defines _GNU_SOURCE _POSIX_C_SOURCE=200112)
21+
endif()
22+
1923
include(FetchContent)
2024
## https://libuv.org
2125
FetchContent_Declare(
@@ -65,6 +69,7 @@ endif()
6569

6670
## Static library target.
6771
add_library(uvwasi_a STATIC ${uvwasi_sources})
72+
target_compile_definitions(uvwasi_a PRIVATE ${uvwasi_defines})
6873
target_compile_options(uvwasi_a PRIVATE ${uvwasi_cflags})
6974
target_include_directories(uvwasi_a PRIVATE ${PROJECT_SOURCE_DIR}/include)
7075
if(CODE_COVERAGE)

0 commit comments

Comments
 (0)