CMake: Fix issues with linkers failing on Linux

This commit is contained in:
TellowKrinkle 2022-12-07 02:15:53 +01:00 committed by TellowKrinkle
parent 1b3c3efcd5
commit a346cff472
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
# Setting it to a range tells it that it supports the features on the newer
# versions as well, avoiding setting policies.
cmake_minimum_required(VERSION 3.11...3.22)
cmake_minimum_required(VERSION 3.12...3.24)
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "PCSX2 does not support in-tree builds. Please make a build directory that is not the PCSX2 source directory and generate your CMake project there using either `cmake -B build_directory` or by running cmake from the build directory.")

View File

@ -6,7 +6,12 @@ add_library(PCSX2_FLAGS INTERFACE)
if (NOT PCSX2_CORE)
add_executable(PCSX2)
else()
add_library(PCSX2)
if(DISABLE_ADVANCE_SIMD OR LTO_PCSX2_CORE)
# Fixes issues with some compiler + linker combinations
add_library(PCSX2 OBJECT)
else()
add_library(PCSX2)
endif()
target_compile_definitions(PCSX2_FLAGS INTERFACE
"PCSX2_CORE"
)