@@ -10,7 +10,7 @@ buildDir="build"
1010if [[ " $OSTYPE " == " linux-gnu" * ]]; then
1111 numThreads=$( nproc --all)
1212elif [[ " $OSTYPE " == " darwin" * ]]; then
13- numThreads=$( sysctl -n hw.ncpu )
13+ numThreads=$( sysctl -n hw.logicalcpu )
1414else
1515 cat << EOF
1616WARNING: Unsupported OSTYPE: cannot determine number of host CPUs"
@@ -196,8 +196,64 @@ mkdir -p "${buildDir}"
196196__logging
197197
198198if [[ " $OSTYPE " == " darwin" * ]]; then
199- export PATH=" $( brew --prefix bison) /bin:$( brew --prefix flex) /bin:$PATH "
200- export CMAKE_PREFIX_PATH=$( brew --prefix or-tools)
199+
200+ _bison=$( brew --prefix bison 2> /dev/null || true)
201+ _flex=$( brew --prefix flex 2> /dev/null || true)
202+ _ortools=$( brew --prefix or-tools 2> /dev/null || true)
203+
204+ if [[ -z " $_bison " || ! -d " $_bison /bin" ]]; then
205+ echo " [ERROR] bison not found or broken. Run: brew install bison" >&2
206+ exit 1
207+ fi
208+ if [[ -z " $_flex " || ! -d " $_flex /bin" ]]; then
209+ echo " [ERROR] flex not found or broken. Run: brew install flex" >&2
210+ exit 1
211+ fi
212+ if [[ -z " $_ortools " || ! -d " $_ortools /lib" || ! -d " $_ortools /include" ]]; then
213+ echo " [ERROR] or-tools not found or broken. Run: brew install or-tools" >&2
214+ exit 1
215+ fi
216+
217+ export PATH=" $_bison /bin:$_flex /bin:$PATH "
218+ export CMAKE_PREFIX_PATH=" ${_ortools} "
219+
220+ _qt5=$( brew --prefix qt@5 2> /dev/null || true)
221+ if [[ -z " $_qt5 " || ! -d " $_qt5 /lib" ]]; then
222+ echo " [ERROR] qt@5 not found or broken. Run: brew install qt@5" >&2
223+ exit 1
224+ fi
225+
226+ cmakeOptions+=" -DQt5_DIR=$_qt5 /lib/cmake/Qt5"
227+
228+ _tcl8=$( brew --prefix tcl-tk@8 2> /dev/null || true)
229+ if [[ -z " $_tcl8 " || ! -d " $_tcl8 /lib" || ! -d " $_tcl8 /include" ]]; then
230+ echo " [ERROR] tcl-tk@8 not found or broken. Run: brew install tcl-tk@8" >&2
231+ exit 1
232+ fi
233+
234+ cmakeOptions+=" -DTCL_LIBRARY=$_tcl8 /lib/libtcl8.6.dylib"
235+
236+ cmakeOptions+=" -DTCL_INCLUDE_PATH=$_tcl8 /include"
237+ cmakeOptions+=" -DFLEX_INCLUDE_DIR=$_flex /include"
238+
239+ cmakeOptions+=" -DCMAKE_CXX_FLAGS=-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED"
240+
241+ _icu=" $( brew --prefix icu4c 2> /dev/null || true) "
242+ if [[ -z " $_icu " || ! -d " $_icu /lib" ]]; then
243+ echo " [ERROR] icu4c not found or broken. Run: brew install icu4c" >&2
244+ exit 1
245+ fi
246+
247+ export LDFLAGS=" -L$_icu /lib"
248+ export CPPFLAGS=" -I$_icu /include"
249+ export PKG_CONFIG_PATH=" $_icu /lib/pkgconfig"
250+
251+ _extra_lib_paths=(" $( brew --prefix) /lib" )
252+
253+ _joined_paths=" $( IFS=:; echo " ${_extra_lib_paths[*]} " ) "
254+
255+ export LIBRARY_PATH=" ${_joined_paths}${LIBRARY_PATH: +: $LIBRARY_PATH } "
256+ echo " [INFO] General LIBRARY_PATH=$LIBRARY_PATH "
201257fi
202258
203259# ==============================================================================
0 commit comments