Skip to content

Commit

Permalink
fix darwin cxx
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Aug 26, 2024
1 parent 600781c commit ddf4f12
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions build_tools/ci/build_test_cpp.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -eu -o errtrace
set -eux -o errtrace

this_dir="$(cd $(dirname $0) && pwd)"
repo_root="$(cd $this_dir/../.. && pwd)"
Expand Down Expand Up @@ -60,19 +60,10 @@ echo '{

cd $iree_dir
CMAKE_ARGS="\
-S $iree_dir \
-B $build_dir \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$install_dir \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DLLVM_TARGET_ARCH=X86 \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DIREE_ENABLE_ASSERTIONS=ON \
-DIREE_BUILD_SAMPLES=OFF \
-DIREE_BUILD_PYTHON_BINDINGS=ON \
Expand All @@ -89,11 +80,21 @@ CMAKE_ARGS="\
-DIREE_CMAKE_PLUGIN_PATHS=$PWD/../iree-amd-aie"

if [[ "$OSTYPE" != "darwin"* ]]; then
CMAKE_ARGS="$CMAKE_ARGS -DIREE_EXTERNAL_HAL_DRIVERS=xrt"
cmake "$CMAKE_ARGS" \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_CXX_COMPILER="${CXX}" \
-DLLVM_TARGET_ARCH=X86 \
-DLLVM_TARGETS_TO_BUILD=X86 \
-DIREE_EXTERNAL_HAL_DRIVERS=xrt \
-S $iree_dir -B $build_dir
else
cmake "$CMAKE_ARGS" \
-S $iree_dir -B $build_dir
fi

cmake $CMAKE_ARGS

echo "Building all"
echo "------------"
cmake --build "$build_dir" -- -k 0
Expand Down

0 comments on commit ddf4f12

Please sign in to comment.