Skip to content

Commit

Permalink
Detect pipe (#1385)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Nov 13, 2019
1 parent 1f91815 commit bf61ce7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ endif ()
include(CheckSymbolExists)
if (WIN32)
check_symbol_exists(open io.h HAVE_OPEN)
check_symbol_exists(pipe io.h HAVE_PIPE)
check_symbol_exists(_strtod_l "${strtod_l_headers}" HAVE_STRTOD_L)
else ()
check_symbol_exists(open fcntl.h HAVE_OPEN)
set(HAVE_PIPE TRUE)
check_symbol_exists(strtod_l "${strtod_l_headers}" HAVE_STRTOD_L)
endif ()

Expand All @@ -155,7 +157,7 @@ add_headers(FMT_HEADERS chrono.h color.h compile.h core.h format.h format-inl.h
locale.h ostream.h printf.h ranges.h
safe-duration-cast.h)
set(FMT_SOURCES src/format.cc)
if (HAVE_OPEN)
if (HAVE_OPEN AND HAVE_PIPE)
add_headers(FMT_HEADERS posix.h)
set(FMT_SOURCES ${FMT_SOURCES} src/posix.cc)
endif ()
Expand Down

0 comments on commit bf61ce7

Please sign in to comment.