Skip to content

Commit 34c9d1e

Browse files
committed
cmake: check for non-empty env value, to not accept defined but empty ones
1 parent a5ddc39 commit 34c9d1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ set(CURL_POST_INSTALL_COMMAND
273273
# Conditionally check to see if there's a source directory or not.
274274
# If there is, use it. Otherwise, download the latest version.
275275
#
276-
if(DEFINED ENV{CURL_SOURCE_DIR})
276+
if(NOT "$ENV{CURL_SOURCE_DIR}" STREQUAL "")
277277
message(STATUS "Building curl from source directory: $ENV{CURL_SOURCE_DIR}")
278278
ExternalProject_Add(
279279
curl_external
@@ -325,10 +325,10 @@ set(CURL_INCLUDE_DIRS
325325
set(CURL_LIB_DIR ${CURL_INSTALL_DIR}/lib)
326326

327327
# Fuzzing engine
328-
if(DEFINED ENV{LIB_FUZZING_ENGINE})
328+
if(NOT "$ENV{LIB_FUZZING_ENGINE}" STREQUAL "")
329329
# Check to see if ENV{LIB_FUZZING_ENGINE} is a file. If so, use it directly.
330330
# Otherwise, assume it's a flag to the compiler.
331-
if(EXISTS $ENV{LIB_FUZZING_ENGINE})
331+
if(EXISTS "$ENV{LIB_FUZZING_ENGINE}")
332332
message(STATUS "Using LIB_FUZZING_ENGINE file: $ENV{LIB_FUZZING_ENGINE}")
333333
set(LIB_FUZZING_ENGINE $ENV{LIB_FUZZING_ENGINE})
334334
set(LIB_FUZZING_ENGINE_FLAG "")

0 commit comments

Comments
 (0)