From 081c31e3a502adf7167c8640398b4d4ee7cb0a17 Mon Sep 17 00:00:00 2001 From: captainurist <73941350+captainurist@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:01:56 +0800 Subject: [PATCH] Fix linking on x86 --- .github/workflows/linux.yml | 2 +- CMakeLists.txt | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 2c6e8d86721f..f7d776181ec3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -113,7 +113,7 @@ jobs: - name: Build working-directory: build run: | - make -j3 + make -j3 VERBOSE=1 - name: Run unit tests working-directory: build diff --git a/CMakeLists.txt b/CMakeLists.txt index f29747b5b9a0..692ff0738c1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,12 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Release") set(OE_USE_PREBUILT_DEPENDENCIES_DEFAULT OFF) endif() endif() +if (BUILD_PLATFORM STREQUAL "linux" AND BUILD_ARCH STREQUAL "x86") + # Prebuilt ffmpeg on x86 linux is built with --enable-asm, and lld chokes when trying to link with it. + set(OE_USE_LD_LLD_DEFAULT OFF) +else() + set(OE_USE_LD_LLD_DEFAULT ON) +endif() # User-settable options. set(OE_BUILD_TESTS ON CACHE BOOL "Build OpenEnroth tests.") @@ -29,7 +35,7 @@ set(OE_USE_PREBUILT_DEPENDENCIES ${OE_USE_PREBUILT_DEPENDENCIES_DEFAULT} CACHE B set(OE_USE_CCACHE ON CACHE BOOL "Use ccache if available.") set(OE_USE_SCCACHE ON CACHE BOOL "Use sccache if available, note that ccache takes precedence.") set(OE_USE_LD_MOLD ON CACHE BOOL "Use mold linker if available.") -set(OE_USE_LD_LLD ON CACHE BOOL "Use lld linker if available, note that mold takes precedence.") +set(OE_USE_LD_LLD ${OE_USE_LD_LLD_DEFAULT} CACHE BOOL "Use lld linker if available, note that mold takes precedence.") set(OE_USE_LD_GOLD ON CACHE BOOL "Use GNU gold linker if available, note that lld takes precedence.") # Find ccache / sccache.