2024-02-27 19:24:47 +01:00
|
|
|
# SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2024-06-27 12:46:55 +02:00
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
set(BUILD_TESTING OFF)
|
|
|
|
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
|
|
|
|
|
2024-02-27 19:24:47 +01:00
|
|
|
if (MSVC)
|
|
|
|
# Silence "deprecation" warnings
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
|
|
|
endif()
|
|
|
|
|
2024-04-14 16:09:51 +02:00
|
|
|
# Boost
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET Boost::headers)
|
2024-07-11 12:07:01 +02:00
|
|
|
set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/externals/ext-boost" CACHE STRING "")
|
|
|
|
set(Boost_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/ext-boost" CACHE STRING "")
|
2024-06-27 12:46:55 +02:00
|
|
|
set(Boost_NO_SYSTEM_PATHS ON CACHE BOOL "")
|
|
|
|
add_library(boost INTERFACE)
|
|
|
|
target_include_directories(boost SYSTEM INTERFACE ${Boost_INCLUDE_DIR})
|
|
|
|
add_library(Boost::headers ALIAS boost)
|
|
|
|
endif()
|
2024-04-14 16:09:51 +02:00
|
|
|
|
2024-04-13 21:37:21 +02:00
|
|
|
# fmtlib
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET fmt::fmt)
|
|
|
|
add_subdirectory(fmt)
|
|
|
|
endif()
|
2024-04-13 21:37:21 +02:00
|
|
|
|
2024-02-29 23:00:35 +01:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND MSVC)
|
|
|
|
# If it is clang and MSVC we will add a static lib
|
|
|
|
# CryptoPP
|
2024-06-27 12:46:55 +02:00
|
|
|
add_subdirectory(cryptoppwin)
|
2024-02-29 23:00:35 +01:00
|
|
|
target_include_directories(cryptoppwin INTERFACE cryptoppwin/include)
|
|
|
|
else()
|
|
|
|
# CryptoPP
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET cryptopp::cryptopp)
|
|
|
|
set(CRYPTOPP_INSTALL OFF)
|
|
|
|
set(CRYPTOPP_BUILD_TESTING OFF)
|
|
|
|
set(CRYPTOPP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/)
|
|
|
|
add_subdirectory(cryptopp-cmake)
|
|
|
|
file(COPY cryptopp DESTINATION cryptopp FILES_MATCHING PATTERN "*.h")
|
|
|
|
target_include_directories(cryptopp INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/cryptopp")
|
|
|
|
endif()
|
2024-02-29 23:00:35 +01:00
|
|
|
endif()
|
|
|
|
|
2024-08-16 17:56:47 +02:00
|
|
|
if (NOT TARGET FFmpeg::ffmpeg)
|
2024-07-26 17:34:36 +02:00
|
|
|
set(ARCHITECTURE "x86_64")
|
|
|
|
add_subdirectory(ffmpeg-core)
|
2024-08-16 17:56:47 +02:00
|
|
|
add_library(FFmpeg::ffmpeg ALIAS ffmpeg)
|
2024-07-26 17:34:36 +02:00
|
|
|
endif()
|
|
|
|
|
2024-03-22 17:12:37 +01:00
|
|
|
# Zlib-Ng
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET zlib-ng::zlib)
|
|
|
|
set(ZLIB_ENABLE_TESTS OFF)
|
|
|
|
set(WITH_GTEST OFF)
|
|
|
|
set(WITH_NEW_STRATEGIES ON)
|
|
|
|
set(WITH_NATIVE_INSTRUCTIONS ON)
|
|
|
|
add_subdirectory(zlib-ng)
|
|
|
|
add_library(zlib-ng::zlib ALIAS zlib)
|
|
|
|
endif()
|
2024-02-27 19:24:47 +01:00
|
|
|
|
2024-03-22 17:12:37 +01:00
|
|
|
# SDL3
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET SDL3::SDL3)
|
2024-07-15 00:29:16 +02:00
|
|
|
set(SDL_PIPEWIRE OFF)
|
2024-06-27 12:46:55 +02:00
|
|
|
add_subdirectory(sdl3)
|
|
|
|
endif()
|
2024-04-14 16:09:51 +02:00
|
|
|
|
|
|
|
# vulkan-headers
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET Vulkan::Headers)
|
|
|
|
set(VULKAN_HEADERS_ENABLE_MODULE OFF)
|
|
|
|
add_subdirectory(vulkan-headers)
|
|
|
|
endif()
|
2024-04-14 16:09:51 +02:00
|
|
|
|
|
|
|
# VMA
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET GPUOpen::VulkanMemoryAllocator)
|
|
|
|
add_subdirectory(vma)
|
|
|
|
endif()
|
2024-04-14 16:09:51 +02:00
|
|
|
|
2024-07-28 15:54:09 +02:00
|
|
|
# RenderDoc
|
|
|
|
if (NOT TARGET RenderDoc::API)
|
|
|
|
add_library(renderdoc INTERFACE)
|
|
|
|
target_include_directories(renderdoc SYSTEM INTERFACE ./renderdoc)
|
|
|
|
add_library(RenderDoc::API ALIAS renderdoc)
|
|
|
|
endif()
|
|
|
|
|
2024-04-14 16:09:51 +02:00
|
|
|
# glslang
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET glslang::glslang)
|
|
|
|
set(SKIP_GLSLANG_INSTALL ON CACHE BOOL "")
|
|
|
|
set(ENABLE_GLSLANG_BINARIES OFF CACHE BOOL "")
|
|
|
|
set(ENABLE_SPVREMAPPER OFF CACHE BOOL "")
|
|
|
|
set(ENABLE_CTEST OFF CACHE BOOL "")
|
|
|
|
set(ENABLE_HLSL OFF CACHE BOOL "")
|
|
|
|
set(BUILD_EXTERNAL OFF CACHE BOOL "")
|
|
|
|
set(ENABLE_OPT OFF CACHE BOOL "")
|
|
|
|
add_subdirectory(glslang)
|
|
|
|
file(COPY glslang/SPIRV DESTINATION glslang/glslang FILES_MATCHING PATTERN "*.h")
|
|
|
|
target_include_directories(SPIRV INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/glslang")
|
|
|
|
endif()
|
2024-04-14 16:09:51 +02:00
|
|
|
|
|
|
|
# Robin-map
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET tsl::robin_map)
|
|
|
|
add_subdirectory(robin-map)
|
|
|
|
endif()
|
2024-05-01 12:38:41 +02:00
|
|
|
|
|
|
|
# Xbyak
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET xbyak::xbyak)
|
|
|
|
add_subdirectory(xbyak)
|
|
|
|
endif()
|
2024-05-09 22:45:09 +02:00
|
|
|
|
2024-05-18 19:05:18 +02:00
|
|
|
# MagicEnum
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET magic_enum::magic_enum)
|
|
|
|
add_subdirectory(magic_enum)
|
|
|
|
endif()
|
2024-05-18 19:05:18 +02:00
|
|
|
|
|
|
|
# Toml11
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET toml11::toml11)
|
|
|
|
add_subdirectory(toml11)
|
|
|
|
endif()
|
2024-05-18 19:05:18 +02:00
|
|
|
|
|
|
|
# xxHash
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET xxHash::xxhash)
|
|
|
|
add_library(xxhash xxhash/xxhash.h xxhash/xxhash.c)
|
|
|
|
target_include_directories(xxhash PUBLIC xxhash)
|
|
|
|
add_library(xxHash::xxhash ALIAS xxhash)
|
|
|
|
endif()
|
2024-05-18 19:05:18 +02:00
|
|
|
|
|
|
|
# Zydis
|
2024-06-27 12:46:55 +02:00
|
|
|
if (NOT TARGET Zydis::Zydis)
|
|
|
|
option(ZYDIS_BUILD_TOOLS "" OFF)
|
|
|
|
option(ZYDIS_BUILD_EXAMPLES "" OFF)
|
|
|
|
add_subdirectory(zydis)
|
|
|
|
endif()
|
2024-05-18 19:05:18 +02:00
|
|
|
|
2024-05-09 22:45:09 +02:00
|
|
|
# Winpthreads
|
|
|
|
if (WIN32)
|
2024-06-27 12:46:55 +02:00
|
|
|
add_subdirectory(winpthreads)
|
2024-05-09 22:45:09 +02:00
|
|
|
target_include_directories(winpthreads INTERFACE winpthreads/include)
|
|
|
|
endif()
|
2024-05-22 00:35:12 +02:00
|
|
|
|
|
|
|
# sirit
|
2024-06-27 12:46:55 +02:00
|
|
|
add_subdirectory(sirit)
|
2024-05-22 13:18:05 +02:00
|
|
|
if (WIN32)
|
|
|
|
target_compile_options(sirit PUBLIC "-Wno-error=unused-command-line-argument")
|
2024-05-25 14:33:15 +02:00
|
|
|
endif()
|
2024-06-10 17:20:49 +02:00
|
|
|
|
2024-07-09 11:18:34 +02:00
|
|
|
# date
|
2024-07-17 10:56:07 +02:00
|
|
|
if (APPLE AND NOT TARGET date::date-tz)
|
2024-07-09 11:18:34 +02:00
|
|
|
option(BUILD_TZ_LIB "" ON)
|
|
|
|
option(USE_SYSTEM_TZ_DB "" ON)
|
|
|
|
add_subdirectory(date)
|
|
|
|
endif()
|
|
|
|
|
2024-06-10 17:20:49 +02:00
|
|
|
# Tracy
|
|
|
|
option(TRACY_ENABLE "" ON)
|
|
|
|
option(TRACY_NO_CRASH_HANDLER "" ON) # Otherwise texture cache exceptions will be treaten as a crash
|
|
|
|
option(TRACY_ON_DEMAND "" ON)
|
|
|
|
option(TRACY_NO_FRAME_IMAGE "" ON)
|
|
|
|
option(TRACY_FIBERS "" ON) # For AmdGpu frontend profiling
|
2024-07-20 11:30:55 +02:00
|
|
|
option(TRACY_NO_SYSTEM_TRACING "" ON)
|
|
|
|
option(TRACY_NO_CALLSTACK "" ON)
|
|
|
|
option(TRACY_NO_CODE_TRANSFER "" ON)
|
|
|
|
option(TRACY_NO_SAMPLING "" ON)
|
|
|
|
option(TRACY_ONLY_LOCALHOST "" ON)
|
|
|
|
option(TRACY_NO_CONTEXT_SWITCH "" ON)
|
2024-06-27 12:46:55 +02:00
|
|
|
add_subdirectory(tracy)
|