1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 20:22:30 +01:00

Use seperately bundled LLVM library

This commit is contained in:
Zion Nimchuk 2023-04-29 10:59:16 -07:00 committed by Ani
parent 84b1624b23
commit f0828ebbc0
4 changed files with 28 additions and 10 deletions

View File

@ -46,6 +46,8 @@ cmake .. \
-DUSE_SYSTEM_CURL=ON \ -DUSE_SYSTEM_CURL=ON \
-DUSE_SDL=OFF \ -DUSE_SDL=OFF \
-DOpenGL_GL_PREFERENCE=LEGACY \ -DOpenGL_GL_PREFERENCE=LEGACY \
-DLLVM_DIR=/opt/llvm/lib/cmake/llvm \
-DSTATIC_LINK_LLVM=ON \
-G Ninja -G Ninja
ninja; build_status=$?; ninja; build_status=$?;

View File

@ -61,7 +61,7 @@ windows_task:
linux_task: linux_task:
container: container:
image: rpcs3/rpcs3-ci-bionic:1.7 image: rpcs3/rpcs3-ci-bionic:1.8
cpu: 4 cpu: 4
memory: 16G memory: 16G
env: env:

33
3rdparty/llvm.cmake vendored
View File

@ -36,21 +36,13 @@ if(WITH_LLVM)
set(LLVM_DIR "${CMAKE_BINARY_DIR}/3rdparty/llvm/llvm_build/lib/cmake/llvm/") set(LLVM_DIR "${CMAKE_BINARY_DIR}/3rdparty/llvm/llvm_build/lib/cmake/llvm/")
set(CMAKE_CXX_FLAGS ${CXX_FLAGS_OLD}) set(CMAKE_CXX_FLAGS ${CXX_FLAGS_OLD})
option(STATIC_LINK_LLVM "" ON)
# now tries to find LLVM again # now tries to find LLVM again
find_package(LLVM 16.0 CONFIG) find_package(LLVM 16.0 CONFIG)
if(NOT LLVM_FOUND) if(NOT LLVM_FOUND)
message(FATAL_ERROR "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`") message(FATAL_ERROR "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`")
endif() endif()
llvm_map_components_to_libnames(LLVM_LIBS
${LLVM_TARGETS_TO_BUILD}
Core
ExecutionEngine
IntelJITEvents
MCJIT
)
else() else()
message(STATUS "Using prebuilt or system LLVM") message(STATUS "Using prebuilt or system LLVM")
@ -70,7 +62,30 @@ if(WITH_LLVM)
message(FATAL_ERROR "Can't find LLVM libraries from the CMAKE_PREFIX_PATH path or LLVM_DIR. \ message(FATAL_ERROR "Can't find LLVM libraries from the CMAKE_PREFIX_PATH path or LLVM_DIR. \
Enable BUILD_LLVM option to build LLVM from included as a git submodule.") Enable BUILD_LLVM option to build LLVM from included as a git submodule.")
endif() endif()
endif()
if (STATIC_LINK_LLVM)
if (NOT DEFINED LLVM_TARGETS_TO_BUILD)
if(COMPILER_ARM)
set(LLVM_TARGETS_TO_BUILD "AArch64;X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
else()
set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".")
endif()
endif()
if(WIN32 OR CMAKE_SYSTEM MATCHES "Linux")
set (LLVM_ADDITIONAL_LIBS ${LLVM_ADDITIONAL_LIBS} IntelJITEvents)
endif()
if(CMAKE_SYSTEM MATCHES "Linux")
set (LLVM_ADDITIONAL_LIBS ${LLVM_ADDITIONAL_LIBS} PerfJITEvents)
endif()
llvm_map_components_to_libnames(LLVM_LIBS
${LLVM_TARGETS_TO_BUILD}
${LLVM_ADDITIONAL_LIBS}
Core
ExecutionEngine
MCJIT
)
else()
set(LLVM_LIBS LLVM) set(LLVM_LIBS LLVM)
endif() endif()

View File

@ -15,6 +15,7 @@ endif()
option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON) option(USE_NATIVE_INSTRUCTIONS "USE_NATIVE_INSTRUCTIONS makes rpcs3 compile with -march=native, which is useful for local builds, but not good for packages." ON)
option(WITH_LLVM "Enable usage of LLVM library" ON) option(WITH_LLVM "Enable usage of LLVM library" ON)
option(BUILD_LLVM "Build LLVM from git submodule" OFF) option(BUILD_LLVM "Build LLVM from git submodule" OFF)
option(STATIC_LINK_LLVM "Link against LLVM statically. This will get set to ON if you build LLVM from the submodule." OFF)
option(USE_FAUDIO "FAudio audio backend" ON) option(USE_FAUDIO "FAudio audio backend" ON)
option(USE_LIBEVDEV "libevdev-based joystick support" ON) option(USE_LIBEVDEV "libevdev-based joystick support" ON)
option(USE_DISCORD_RPC "Discord rich presence integration" OFF) option(USE_DISCORD_RPC "Discord rich presence integration" OFF)