Skip to content

Commit

Permalink
Fix fl_dependent_option with value definition (flashlight#1160)
Browse files Browse the repository at this point in the history
Summary:
See title. New versions of CMake seem to have broke this behavior in some corner case.

Fixes flashlight#1159

Pull Request resolved: flashlight#1160

Test Plan:
Local test with improperly specified (i.e. incomplete) specification of required pkgs to build a particular app

> cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFL_USE_ONEDNN=OFF -DFL_USE_ARRAYFIRE=ON -DFL_ARRAYFIRE_USE_CUDA=OFF -DFL_BUILD_APP_ASR=ON   -DArrayFire_DIR=/checkpoint/jacobkahn/usr/share/ArrayFire/cmake -DFL_ARRAYFIRE_USE_CPU=ON -DFL_BUILD_PKG_RUNTIME=ON -DFL_BUILD_PKG_SPEECH=ON

Differential Revision: D51292645

Pulled By: jacobkahn

fbshipit-source-id: f9c4f458171efa4407789bda3ea0871ef086c4ec
  • Loading branch information
jacobkahn authored and facebook-github-bot committed Nov 14, 2023
1 parent 633f256 commit 0109afa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/InternalUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function(fl_dependent_option)
set(_frce ${fl_dependent_option_FRCE})

foreach(_dep IN ITEMS ${_deps})
if(NOT "${${_dep}}" AND "${_option}" AND "${${_option}}")
if(NOT "${${_dep}}" AND DEFINED ${_option} AND "${${_option}}")
message(FATAL_ERROR "${_dep} Required to build ${_option}")
endif()
endforeach()
Expand Down

0 comments on commit 0109afa

Please sign in to comment.