Skip to content

Enable LTO on the Linux Clang build on CI #3491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
run: python check.py --binaryen-bin=out/bin

build-clang:
name: clang
name: clang (LTO)
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
Expand All @@ -115,9 +115,9 @@ jobs:
- name: cmake
run: |
mkdir -p out
cmake -S . -B out -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
cmake -S . -B out -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DBYN_ENABLE_LTO=ON
- name: build
run: cmake --build out
run: cmake --build out -v
- name: test binaryen-lit
run: python out/bin/binaryen-lit test/lit/parse-error.wast
- name: test
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ ENDFOREACH()

option(BYN_ENABLE_LTO "Build with LTO" Off)
if(BYN_ENABLE_LTO)
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed? docs say it allows regexes, but the right side isn't one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apple's clang has the compiler ID AppleClang which MATCHES clang but isn't STREQUAL. Using MATCHES with bare strings seems pretty common in CMake files (it definitely is in LLVM's)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, sgtm.

message(FATAL_ERROR "ThinLTO is only supported by clang")
endif()
if(NOT APPLE)
Expand Down