Skip to content

Commit

Permalink
build: windows: Eagerly fail on missing openssl or flex
Browse files Browse the repository at this point in the history
Windows builds will fail if flex, bison or the OpenSSL libraries
are missing. So modify the CMake code to ensure that we fail at
CMake time, rather than during the subsequent build.

Signed-off-by: Craig Ringer <[email protected]>
  • Loading branch information
ringerc authored and edsiper committed Dec 19, 2023
1 parent 9f5579d commit 7cbee16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,12 @@ if(FLB_TLS)
if(OPENSSL_FOUND)
FLB_DEFINITION(FLB_HAVE_OPENSSL)
endif()

if (FLB_SYSTEM_WINDOWS AND NOT(OPENSSL_FOUND))
# win32 builds w/o openssl will fail later so we might as well catch it
# early instead.
MESSAGE(FATAL_ERROR "OpenSSL required on Windows, see DEVELOPER_GUIDE.md")
endif()
endif()

# Metrics
Expand Down
7 changes: 4 additions & 3 deletions cmake/windows-setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ find_package(FLEX)
find_package(BISON)

if (NOT (${FLEX_FOUND} AND ${BISON_FOUND}))
message(STATUS "flex and bison not found. Disable stream_processor building.")
set(FLB_STREAM_PROCESSOR No)
set(FLB_RECORD_ACCESSOR No)
# The build will fail later if flex and bison are missing, so there's no
# point attempting to continue. There's no test cover for windows builds
# without FLB_PARSER anyway.
message(FATAL_ERROR "flex and bison not found, see DEVELOPER_GUIDE.md")
endif()

if (MSVC)
Expand Down

0 comments on commit 7cbee16

Please sign in to comment.