Skip to content

Commit

Permalink
add target_arch for Linux clang and some more C flags
Browse files Browse the repository at this point in the history
  • Loading branch information
ParkMyCar committed Sep 3, 2024
1 parent b1e8f0c commit a5073ed
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ on:
- toolchains-ubuntu-22.04-x86
- toolchains-ubuntu-22.04-arm
cpu_target:
description: "Type of CPU to optimize for."
description: "Type of CPU to optimize for. (-mcpu)"
type: string
required: false
arch_target:
description: "Type of micro architecture to optimize for. (-march)"
type: string
required: false
github_tag:
Expand Down Expand Up @@ -58,6 +62,12 @@ jobs:
fi
echo "TARGET_CPU_ARG=$TARGET_CPU_ARG" >> $GITHUB_ENV
TARGET_ARCH_ARG=""
if [ -n "${{ inputs.target_arch }}" ]; then
TARGET_ARCH_ARG="-mcpu=${{ inputs.target_arch }}"
fi
echo "TARGET_ARCH_ARG=$TARGET_ARCH_ARG" >> $GITHUB_ENV
case ${{ inputs.runner }} in
toolchains-ubuntu-22.04-x86)
CLANG_ARCH=x86_64
Expand Down Expand Up @@ -103,8 +113,8 @@ jobs:
cd llvm-project
cmake -G Ninja -S llvm -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="$TARGET_CPU_ARG -flto=thin -pthread" \
-DCMAKE_CXX_FLAGS="$TARGET_CPU_ARG -flto=thin -pthread" \
-DCMAKE_C_FLAGS="$TARGET_CPU_ARG $TARGET_ARCH_ARG -flto=thin -pthread -fPIC -O3 -DNDEBUG" \
-DCMAKE_CXX_FLAGS="$TARGET_CPU_ARG $TARGET_ARCH_ARG -flto=thin -pthread -fPIC -O3 -DNDEBUG" \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION="on" \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind;compiler-rt" \
Expand Down

0 comments on commit a5073ed

Please sign in to comment.