Skip to content

Commit

Permalink
src: suppress warnings in uvwasi.c (#70)
Browse files Browse the repository at this point in the history
Define `_GNU_SOURCE` and `_POSIX_C_SOURCE` to suppress
compilation warnings.

Refs: nodejs/node#31139
  • Loading branch information
HarshithaKP authored and cjihrig committed Jan 10, 2020
1 parent 75b389c commit 676ba9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if(APPLE)
set(CMAKE_MACOSX_RPATH ON)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND uvwasi_defines _GNU_SOURCE _POSIX_C_SOURCE=200112)
endif()

include(FetchContent)
## https://libuv.org
FetchContent_Declare(
Expand Down Expand Up @@ -65,6 +69,7 @@ endif()

## Static library target.
add_library(uvwasi_a STATIC ${uvwasi_sources})
target_compile_definitions(uvwasi_a PRIVATE ${uvwasi_defines})
target_compile_options(uvwasi_a PRIVATE ${uvwasi_cflags})
target_include_directories(uvwasi_a PRIVATE ${PROJECT_SOURCE_DIR}/include)
if(CODE_COVERAGE)
Expand Down

0 comments on commit 676ba9a

Please sign in to comment.