[cmake] CPMUtil: formatting, git_host, new repos, more system deps, libusb #392
10 changed files with 46 additions and 43 deletions
|
@ -98,6 +98,7 @@ option(YUZU_DOWNLOAD_ANDROID_VVL "Download validation layer binary for android"
|
|||
|
||||
option(FORCE_DOWNLOAD_WIN_BUNDLES "Forcefully download bundled Windows dependencies (useful for CI)" OFF)
|
||||
|
||||
# TODO(crueter): Cleanup, each dep that has a bundled option should allow to choose between bundled, external, system
|
||||
if (YUZU_USE_CPM AND ENABLE_SDL2)
|
||||
option(YUZU_USE_BUNDLED_SDL2 "Download bundled SDL2 build" "${MSVC}")
|
||||
endif()
|
||||
|
@ -106,7 +107,7 @@ CMAKE_DEPENDENT_OPTION(YUZU_ROOM "Enable dedicated room functionality" ON "NOT A
|
|||
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_ROOM_STANDALONE "Enable standalone room executable" ON "YUZU_ROOM" OFF)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "NOT ANDROID" OFF)
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "ENABLE_SDL2;NOT ANDROID" OFF)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF)
|
||||
|
||||
|
@ -276,7 +277,7 @@ function(detect_architecture symbol arch)
|
|||
if (ARCHITECTURE_${arch})
|
||||
set(ARCHITECTURE "${arch}" PARENT_SCOPE)
|
||||
set(ARCHITECTURE_${arch} 1 PARENT_SCOPE)
|
||||
add_definitions(-DARCHITECTURE_${arch}=1)
|
||||
add_compile_definitions(ARCHITECTURE_${arch}=1)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
@ -298,7 +299,7 @@ endif()
|
|||
if (NOT DEFINED ARCHITECTURE)
|
||||
set(ARCHITECTURE "GENERIC")
|
||||
set(ARCHITECTURE_GENERIC 1)
|
||||
add_definitions(-DARCHITECTURE_GENERIC=1)
|
||||
add_compile_definitions(ARCHITECTURE_GENERIC=1)
|
||||
endif()
|
||||
|
||||
message(STATUS "Target architecture: ${ARCHITECTURE}")
|
||||
|
@ -310,16 +311,16 @@ if (MSVC AND ARCHITECTURE_x86)
|
|||
endif()
|
||||
|
||||
if (UNIX)
|
||||
add_definitions(-DYUZU_UNIX=1)
|
||||
add_compile_definitions(YUZU_UNIX=1)
|
||||
endif()
|
||||
|
||||
if (ARCHITECTURE_arm64 AND (ANDROID OR PLATFORM_LINUX))
|
||||
set(HAS_NCE 1)
|
||||
add_definitions(-DHAS_NCE=1)
|
||||
add_compile_definitions(HAS_NCE=1)
|
||||
endif()
|
||||
|
||||
if (YUZU_ROOM)
|
||||
add_definitions(-DYUZU_ROOM)
|
||||
add_compile_definitions(YUZU_ROOM)
|
||||
endif()
|
||||
|
||||
# Build/optimization presets
|
||||
|
@ -735,7 +736,7 @@ if (APPLE)
|
|||
list(APPEND PLATFORM_LIBRARIES ${ICONV_LIBRARY})
|
||||
elseif (WIN32)
|
||||
# Target Windows 10
|
||||
add_definitions(-D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00)
|
||||
add_compile_definitions(_WIN32_WINNT=0x0A00 WINVER=0x0A00)
|
||||
set(PLATFORM_LIBRARIES winmm ws2_32 iphlpapi)
|
||||
if (MINGW)
|
||||
# PSAPI is the Process Status API
|
||||
|
|
2
externals/CMakeLists.txt
vendored
2
externals/CMakeLists.txt
vendored
|
@ -239,7 +239,7 @@ if (YUZU_CRASH_DUMPS AND NOT TARGET libbreakpad_client)
|
|||
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES ${breakpad_SOURCE_DIR}/src/client/mac/*.cc ${breakpad_SOURCE_DIR}/src/common/mac/*.cc)
|
||||
list(APPEND LIBBREAKPAD_CLIENT_SOURCES ${breakpad_SOURCE_DIR}/src/common/mac/MachIPC.mm)
|
||||
else()
|
||||
target_compile_definitions(libbreakpad_client PUBLIC -DHAVE_A_OUT_H)
|
||||
target_compile_definitions(libbreakpad_client PUBLIC HAVE_A_OUT_H)
|
||||
file(GLOB_RECURSE LIBBREAKPAD_CLIENT_SOURCES ${breakpad_SOURCE_DIR}/src/client/linux/*.cc ${breakpad_SOURCE_DIR}/src/common/linux/*.cc)
|
||||
endif()
|
||||
list(APPEND LIBBREAKPAD_CLIENT_SOURCES ${LIBBREAKPAD_COMMON_SOURCES})
|
||||
|
|
|
@ -22,16 +22,16 @@ if (MSVC)
|
|||
set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE)
|
||||
|
||||
# Silence "deprecation" warnings
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_DEPRECATE _SCL_SECURE_NO_WARNINGS)
|
||||
|
||||
# Avoid windows.h junk
|
||||
add_definitions(-DNOMINMAX)
|
||||
add_compile_definitions(NOMINMAX)
|
||||
|
||||
# Avoid windows.h from including some usually unused libs like winsocks.h, since this might cause some redefinition errors.
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN)
|
||||
add_compile_definitions(WIN32_LEAN_AND_MEAN)
|
||||
|
||||
# Ensure that projects are built with Unicode support.
|
||||
add_definitions(-DUNICODE -D_UNICODE)
|
||||
add_compile_definitions(UNICODE _UNICODE)
|
||||
|
||||
# /W4 - Level 4 warnings
|
||||
# /MP - Multi-threaded compilation
|
||||
|
@ -169,15 +169,15 @@ else()
|
|||
# glibc, which may default to 32 bits. glibc allows this to be configured
|
||||
# by setting _FILE_OFFSET_BITS.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW)
|
||||
add_definitions(-D_FILE_OFFSET_BITS=64)
|
||||
add_compile_definitions(_FILE_OFFSET_BITS=64)
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
add_definitions(-DMINGW_HAS_SECURE_API)
|
||||
add_compile_definitions(MINGW_HAS_SECURE_API)
|
||||
add_compile_options("-msse4.1")
|
||||
|
||||
if (MINGW_STATIC_BUILD)
|
||||
add_definitions(-DQT_STATICPLUGIN)
|
||||
add_compile_definitions(QT_STATICPLUGIN)
|
||||
add_compile_options("-static")
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -229,9 +229,10 @@ endif()
|
|||
target_include_directories(audio_core PRIVATE ${OPUS_INCLUDE_DIRS})
|
||||
target_link_libraries(audio_core PUBLIC common core opus)
|
||||
|
||||
if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
|
||||
target_link_libraries(audio_core PRIVATE dynarmic::dynarmic)
|
||||
endif()
|
||||
# what?
|
||||
# if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64)
|
||||
# target_link_libraries(audio_core PRIVATE dynarmic::dynarmic)
|
||||
# endif()
|
||||
|
||||
if (ENABLE_CUBEB)
|
||||
target_sources(audio_core PRIVATE
|
||||
|
@ -240,7 +241,7 @@ if (ENABLE_CUBEB)
|
|||
)
|
||||
|
||||
target_link_libraries(audio_core PRIVATE cubeb)
|
||||
target_compile_definitions(audio_core PRIVATE -DHAVE_CUBEB=1)
|
||||
target_compile_definitions(audio_core PRIVATE HAVE_CUBEB=1)
|
||||
endif()
|
||||
|
||||
if (ENABLE_SDL2)
|
||||
|
|
|
@ -1155,7 +1155,7 @@ add_library(core STATIC
|
|||
|
||||
if (ENABLE_WIFI_SCAN)
|
||||
# find_package(libiw REQUIRED)
|
||||
target_compile_definitions(core PRIVATE -DENABLE_WIFI_SCAN)
|
||||
target_compile_definitions(core PRIVATE ENABLE_WIFI_SCAN)
|
||||
target_link_libraries(core PRIVATE iw)
|
||||
endif()
|
||||
|
||||
|
@ -1202,7 +1202,7 @@ if (MINGW)
|
|||
endif()
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(core PUBLIC -DENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE)
|
||||
target_link_libraries(core PUBLIC web_service)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ add_library(yuzu-room STATIC EXCLUDE_FROM_ALL
|
|||
|
||||
target_link_libraries(yuzu-room PRIVATE common network)
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(yuzu-room PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(yuzu-room PRIVATE ENABLE_WEB_SERVICE)
|
||||
target_link_libraries(yuzu-room PRIVATE web_service)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ create_target_directory_groups(network)
|
|||
|
||||
target_link_libraries(network PRIVATE common enet Boost::headers)
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(network PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(network PRIVATE ENABLE_WEB_SERVICE)
|
||||
target_link_libraries(network PRIVATE web_service)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -332,8 +332,10 @@ target_link_options(video_core PRIVATE ${FFmpeg_LDFLAGS})
|
|||
add_dependencies(video_core host_shaders)
|
||||
target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE})
|
||||
|
||||
target_link_libraries(video_core PRIVATE sirit Vulkan::Headers Vulkan::UtilityHeaders)
|
||||
target_link_libraries(video_core PUBLIC GPUOpen::VulkanMemoryAllocator)
|
||||
target_link_libraries(video_core PRIVATE sirit)
|
||||
|
||||
# Header-only stuff needed by all dependent targets
|
||||
target_link_libraries(video_core PUBLIC Vulkan::Headers Vulkan::UtilityHeaders GPUOpen::VulkanMemoryAllocator)
|
||||
|
||||
if (ENABLE_NSIGHT_AFTERMATH)
|
||||
if (NOT DEFINED ENV{NSIGHT_AFTERMATH_SDK})
|
||||
|
|
|
@ -401,7 +401,6 @@ target_link_libraries(yuzu PRIVATE nlohmann_json::nlohmann_json)
|
|||
target_link_libraries(yuzu PRIVATE Boost::headers glad Qt6::Widgets)
|
||||
target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
||||
|
||||
target_link_libraries(yuzu PRIVATE Vulkan::Headers)
|
||||
if (NOT WIN32)
|
||||
target_include_directories(yuzu PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
@ -416,24 +415,24 @@ endif()
|
|||
target_compile_definitions(yuzu PRIVATE
|
||||
# Use QStringBuilder for string concatenation to reduce
|
||||
# the overall number of temporary strings created.
|
||||
-DQT_USE_QSTRINGBUILDER
|
||||
QT_USE_QSTRINGBUILDER
|
||||
|
||||
# Disable implicit conversions from/to C strings
|
||||
-DQT_NO_CAST_FROM_ASCII
|
||||
-DQT_NO_CAST_TO_ASCII
|
||||
QT_NO_CAST_FROM_ASCII
|
||||
QT_NO_CAST_TO_ASCII
|
||||
|
||||
# Disable implicit type narrowing in signal/slot connect() calls.
|
||||
-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
||||
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
||||
|
||||
# Disable unsafe overloads of QProcess' start() function.
|
||||
-DQT_NO_PROCESS_COMBINED_ARGUMENT_START
|
||||
QT_NO_PROCESS_COMBINED_ARGUMENT_START
|
||||
|
||||
# Disable implicit QString->QUrl conversions to enforce use of proper resolving functions.
|
||||
-DQT_NO_URL_CAST_FROM_STRING
|
||||
QT_NO_URL_CAST_FROM_STRING
|
||||
)
|
||||
|
||||
if (YUZU_ENABLE_COMPATIBILITY_REPORTING)
|
||||
target_compile_definitions(yuzu PRIVATE -DYUZU_ENABLE_COMPATIBILITY_REPORTING)
|
||||
target_compile_definitions(yuzu PRIVATE YUZU_ENABLE_COMPATIBILITY_REPORTING)
|
||||
endif()
|
||||
|
||||
if (USE_DISCORD_PRESENCE)
|
||||
|
@ -441,22 +440,22 @@ if (USE_DISCORD_PRESENCE)
|
|||
discord_impl.cpp
|
||||
discord_impl.h
|
||||
)
|
||||
target_link_libraries(yuzu PRIVATE DiscordRPC::discord-rpc httplib::httplib Qt${QT_MAJOR_VERSION}::Network)
|
||||
target_compile_definitions(yuzu PRIVATE -DUSE_DISCORD_PRESENCE)
|
||||
target_link_libraries(yuzu PRIVATE DiscordRPC::discord-rpc httplib::httplib Qt6::Network)
|
||||
target_compile_definitions(yuzu PRIVATE USE_DISCORD_PRESENCE)
|
||||
endif()
|
||||
|
||||
if (ENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(yuzu PRIVATE -DENABLE_WEB_SERVICE)
|
||||
target_compile_definitions(yuzu PRIVATE ENABLE_WEB_SERVICE)
|
||||
endif()
|
||||
|
||||
if (YUZU_USE_QT_MULTIMEDIA)
|
||||
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::Multimedia)
|
||||
target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_MULTIMEDIA)
|
||||
target_link_libraries(yuzu PRIVATE Qt6::Multimedia)
|
||||
target_compile_definitions(yuzu PRIVATE YUZU_USE_QT_MULTIMEDIA)
|
||||
endif ()
|
||||
|
||||
if (YUZU_USE_QT_WEB_ENGINE)
|
||||
target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::WebEngineCore Qt${QT_MAJOR_VERSION}::WebEngineWidgets)
|
||||
target_compile_definitions(yuzu PRIVATE -DYUZU_USE_QT_WEB_ENGINE)
|
||||
target_link_libraries(yuzu PRIVATE Qt6::WebEngineCore Qt6::WebEngineWidgets)
|
||||
target_compile_definitions(yuzu PRIVATE YUZU_USE_QT_WEB_ENGINE)
|
||||
endif ()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
|
@ -468,6 +467,7 @@ if (WIN32 AND NOT YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_GREATER_EQUAL 6)
|
|||
add_custom_command(TARGET yuzu POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${YUZU_EXE_DIR}/eden.exe" --dir "${YUZU_EXE_DIR}" --libdir "${YUZU_EXE_DIR}" --plugindir "${YUZU_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0)
|
||||
endif()
|
||||
|
||||
# TODO(crueter): this can be done with system qt in a better way
|
||||
if (YUZU_USE_BUNDLED_QT)
|
||||
include(CopyYuzuQt6Deps)
|
||||
copy_yuzu_Qt6_deps(yuzu)
|
||||
|
|
|
@ -28,7 +28,7 @@ add_executable(yuzu-cmd
|
|||
yuzu.rc
|
||||
)
|
||||
|
||||
target_link_libraries(yuzu-cmd PRIVATE common core input_common frontend_common)
|
||||
target_link_libraries(yuzu-cmd PRIVATE common core input_common frontend_common video_core)
|
||||
target_link_libraries(yuzu-cmd PRIVATE glad)
|
||||
if (MSVC)
|
||||
target_link_libraries(yuzu-cmd PRIVATE getopt)
|
||||
|
@ -38,8 +38,7 @@ target_link_libraries(yuzu-cmd PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
|
|||
create_resource("../../dist/yuzu.bmp" "yuzu_cmd/yuzu_icon.h" "yuzu_icon")
|
||||
target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR})
|
||||
|
||||
target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers)
|
||||
target_link_libraries(yuzu-cmd PRIVATE GPUOpen::VulkanMemoryAllocator)
|
||||
target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
install(TARGETS yuzu-cmd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue