Skip to content

Commit

Permalink
disable lto for openclc build for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
e253 committed Jul 25, 2024
1 parent 8f8151c commit 5849ee5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build-openclc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ esac
# Now we have Zig as a cross compiler.
ZIG="$HOME/.zvm/bin/zig"

if [ $TARGET_OS_CMAKE = "windows" ]; then
CXX="$ZIG;c++;-fno-sanitize=all;-fno-lto;-s;-target;$TARGET;-mcpu=$MCPU"
else
CXX="$ZIG;c++;-fno-sanitize=all;-s;-target;$TARGET;-mcpu=$MCPU"
fi

mkdir -p "$ROOTDIR/out/build-openclc-$TARGET-$MCPU"
cd "$ROOTDIR/out/build-openclc-$TARGET-$MCPU"
cmake "$ROOTDIR/openclc" \
Expand All @@ -29,7 +35,7 @@ cmake "$ROOTDIR/openclc" \
-DCMAKE_BUILD_TYPE="$3" \
-DCMAKE_CROSSCOMPILING=True \
-DCMAKE_SYSTEM_NAME="$TARGET_OS_CMAKE" \
-DCMAKE_CXX_COMPILER="$ZIG;c++;-fno-sanitize=all;-s;-target;$TARGET;-mcpu=$MCPU" \
-DCMAKE_CXX_COMPILER="$CXX" \
-DOPENCLC_ZIG_BUILD_LIB="$ZIG;build-lib;-target;$TARGET;-mcpu=$MCPU" \
-DCMAKE_AR="/usr/bin/llvm-ar-18" \
-DCMAKE_RANLIB="/usr/bin/llvm-ranlib-18" \
Expand Down

0 comments on commit 5849ee5

Please sign in to comment.