Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
b5207d4b5b Update src/video_core/CMakeLists.txt 2025-08-04 09:40:06 +02:00
fd06ce4bfd [cmake] Unbreak FreeBSD Building Process 2025-08-04 09:35:33 +00:00

View file

@ -1,5 +1,8 @@
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project SPDX-License-Identifier:
# GPL-2.0-or-later
add_subdirectory(host_shaders)
@ -9,7 +12,8 @@ if(LIBVA_FOUND)
list(APPEND FFmpeg_LIBRARIES ${LIBVA_LIBRARIES})
endif()
add_library(video_core STATIC
add_library(
video_core STATIC
buffer_cache/buffer_base.h
buffer_cache/buffer_cache_base.h
buffer_cache/buffer_cache.cpp
@ -312,13 +316,12 @@ add_library(video_core STATIC
vulkan_common/nsight_aftermath_tracker.h
vulkan_common/vma.cpp
vulkan_common/vma.h
vulkan_common/vulkan.h
)
vulkan_common/vulkan.h)
target_link_libraries(video_core PUBLIC common core)
target_link_libraries(video_core PUBLIC glad shader_recompiler stb bc_decoder)
if (YUZU_USE_BUNDLED_FFMPEG AND NOT (WIN32 OR ANDROID))
if(YUZU_USE_BUNDLED_FFMPEG AND NOT (WIN32 OR ANDROID))
add_dependencies(video_core ffmpeg-build)
endif()
@ -329,82 +332,98 @@ target_link_options(video_core PRIVATE ${FFmpeg_LDFLAGS})
add_dependencies(video_core host_shaders)
target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
if (VulkanMemoryAllocator_ADDED)
target_include_directories(video_core PUBLIC ${VulkanMemoryAllocator_SOURCE_DIR}/include)
if(VulkanMemoryAllocator_ADDED)
target_include_directories(video_core
PUBLIC ${VulkanMemoryAllocator_SOURCE_DIR}/include)
endif()
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers VulkanUtilityHeaders)
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers
VulkanUtilityHeaders)
endif()
if (ENABLE_NSIGHT_AFTERMATH)
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
message(FATAL_ERROR "Environment variable NSIGHT_AFTERMATH_SDK has to be provided")
if(ENABLE_NSIGHT_AFTERMATH)
if(NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
message(
FATAL_ERROR "Environment variable NSIGHT_AFTERMATH_SDK has to be provided"
)
endif()
if (NOT WIN32)
message(FATAL_ERROR "Nsight Aftermath doesn't support non-Windows platforms")
if(NOT WIN32)
message(
FATAL_ERROR "Nsight Aftermath doesn't support non-Windows platforms")
endif()
target_compile_definitions(video_core PRIVATE HAS_NSIGHT_AFTERMATH)
target_include_directories(video_core PRIVATE "$ENV{NSIGHT_AFTERMATH_SDK}/include")
target_include_directories(video_core
PRIVATE "$ENV{NSIGHT_AFTERMATH_SDK}/include")
endif()
if (MSVC)
target_compile_options(video_core PRIVATE
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
if(MSVC)
target_compile_options(
video_core
PRIVATE /we4242 # 'identifier': conversion from 'type1' to 'type2', possible
# loss of data
/we4244 # 'conversion': conversion from 'type1' to 'type2', possible
# loss of data
)
else()
if (APPLE)
# error: declaration shadows a typedef in 'interval_base_set<SubType, DomainT, Compare, Interval, Alloc>'
# error: implicit conversion loses integer precision: 'int' to 'boost::icl::bound_type' (aka 'unsigned char')
target_compile_options(video_core PRIVATE -Wno-shadow -Wno-unused-local-typedef)
if(APPLE)
# error: declaration shadows a typedef in 'interval_base_set<SubType,
# DomainT, Compare, Interval, Alloc>' error: implicit conversion loses
# integer precision: 'int' to 'boost::icl::bound_type' (aka 'unsigned char')
target_compile_options(video_core PRIVATE -Wno-shadow
-Wno-unused-local-typedef)
else()
target_compile_options(video_core PRIVATE -Werror=conversion)
endif()
target_compile_options(video_core PRIVATE
-Wno-sign-conversion
)
target_compile_options(video_core PRIVATE -Wno-sign-conversion)
# xbyak
set_source_files_properties(macro/macro_jit_x64.cpp PROPERTIES COMPILE_OPTIONS "-Wno-conversion;-Wno-shadow")
set_source_files_properties(
macro/macro_jit_x64.cpp PROPERTIES COMPILE_OPTIONS
"-Wno-conversion;-Wno-shadow")
# VMA
set_source_files_properties(vulkan_common/vma.cpp PROPERTIES COMPILE_OPTIONS "-Wno-conversion;-Wno-unused-variable;-Wno-unused-parameter;-Wno-missing-field-initializers")
set_source_files_properties(
vulkan_common/vma.cpp
PROPERTIES
COMPILE_OPTIONS
"-Wno-conversion;-Wno-unused-variable;-Wno-unused-parameter;-Wno-missing-field-initializers"
)
# Get around GCC failing with intrinsics in Debug
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE MATCHES "Debug")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_BUILD_TYPE MATCHES "Debug")
set_source_files_properties(host1x/vic.cpp PROPERTIES COMPILE_OPTIONS "-O2")
endif()
endif()
if (ARCHITECTURE_x86_64)
target_sources(video_core PRIVATE
macro/macro_jit_x64.cpp
macro/macro_jit_x64.h
)
if(ARCHITECTURE_x86_64)
target_sources(video_core PRIVATE macro/macro_jit_x64.cpp
macro/macro_jit_x64.h)
target_link_libraries(video_core PUBLIC xbyak::xbyak)
if (NOT MSVC)
if(NOT MSVC)
target_compile_options(video_core PRIVATE -msse4.1)
endif()
endif()
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
if(ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
target_link_libraries(video_core PRIVATE dynarmic::dynarmic)
endif()
if (YUZU_USE_PRECOMPILED_HEADERS)
if(YUZU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(video_core PRIVATE precompiled_headers.h)
endif()
if (YUZU_ENABLE_LTO)
if(YUZU_ENABLE_LTO)
set_property(TARGET video_core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
if (ANDROID AND ARCHITECTURE_arm64)
if(ANDROID AND ARCHITECTURE_arm64)
target_link_libraries(video_core PRIVATE adrenotools)
endif()
if (ARCHITECTURE_arm64)
if(ARCHITECTURE_arm64)
target_link_libraries(video_core PRIVATE sse2neon)
endif()