From ff6343d4a47d251a6bd1c8d778e07984625428b9 Mon Sep 17 00:00:00 2001 From: crueter Date: Tue, 13 Jan 2026 21:04:16 -0500 Subject: [PATCH] cmake-format Signed-off-by: crueter --- src/common/CMakeLists.txt | 407 +++++++++++++++++++------------------- src/core/CMakeLists.txt | 28 ++- 2 files changed, 216 insertions(+), 219 deletions(-) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 77a1f7852b..8ec0f113bb 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -5,241 +5,240 @@ # GPL-2.0-or-later if(DEFINED ENV{AZURECIREPO}) - set(BUILD_REPOSITORY $ENV{AZURECIREPO}) + set(BUILD_REPOSITORY $ENV{AZURECIREPO}) endif() if(DEFINED ENV{TITLEBARFORMATIDLE}) - set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE}) + set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE}) endif() if(DEFINED ENV{TITLEBARFORMATRUNNING}) - set(TITLE_BAR_FORMAT_RUNNING $ENV{TITLEBARFORMATRUNNING}) + set(TITLE_BAR_FORMAT_RUNNING $ENV{TITLEBARFORMATRUNNING}) endif() if(DEFINED ENV{DISPLAYVERSION}) - set(DISPLAY_VERSION $ENV{DISPLAYVERSION}) + set(DISPLAY_VERSION $ENV{DISPLAYVERSION}) endif() include(GenerateSCMRev) add_library( - common STATIC - address_space.cpp - address_space.h - algorithm.h - alignment.h - announce_multiplayer_room.h - assert.cpp - assert.h - atomic_ops.h - bit_field.h - bit_util.h - bounded_threadsafe_queue.h - cityhash.cpp - cityhash.h - common_funcs.h - common_types.h - concepts.h - container_hash.h - demangle.cpp - demangle.h - detached_tasks.cpp - detached_tasks.h - device_power_state.cpp - device_power_state.h - div_ceil.h - dynamic_library.cpp - dynamic_library.h - elf.h - error.cpp - error.h - expected.h - fiber.cpp - fiber.h - fixed_point.h - free_region_manager.h - fs/file.cpp - fs/file.h - fs/fs.cpp - fs/fs.h - fs/fs_paths.h - fs/fs_types.h - fs/fs_util.cpp - fs/fs_util.h - fs/path_util.cpp - fs/path_util.h - hash.h - heap_tracker.cpp - heap_tracker.h - hex_util.cpp - hex_util.h - host_memory.cpp - host_memory.h - input.h - intrusive_red_black_tree.h - literals.h - logging/backend.cpp - logging/backend.h - logging/filter.cpp - logging/filter.h - logging/formatter.h - logging/log.h - logging/log_entry.h - logging/text_formatter.cpp - logging/text_formatter.h - logging/types.h - lz4_compression.cpp - lz4_compression.h - make_unique_for_overwrite.h - math_util.h - memory_detect.cpp - memory_detect.h - multi_level_page_table.cpp - multi_level_page_table.h - overflow.h - page_table.cpp - page_table.h - param_package.cpp - param_package.h - parent_of_member.h - point.h - quaternion.h - range_map.h - range_mutex.h - range_sets.h - range_sets.inc - ring_buffer.h - ${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp - scm_rev.h - scope_exit.h - scratch_buffer.h - settings.cpp - settings.h - settings_common.cpp - settings_common.h - settings_enums.h - settings_input.cpp - settings_input.h - settings_setting.h - slot_vector.h - socket_types.h - spin_lock.h - stb.cpp - stb.h - steady_clock.cpp - steady_clock.h - stream.cpp - stream.h - string_util.cpp - string_util.h - swap.h - thread.cpp - thread.h - thread_queue_list.h - thread_worker.h - threadsafe_queue.h - time_zone.cpp - time_zone.h - tiny_mt.h - tree.h - typed_address.h - uint128.h - unique_function.h - uuid.cpp - uuid.h - vector_math.h - virtual_buffer.cpp - virtual_buffer.h - wall_clock.cpp - wall_clock.h - zstd_compression.cpp - zstd_compression.h - fs/ryujinx_compat.h fs/ryujinx_compat.cpp - fs/symlink.h fs/symlink.cpp -) + common STATIC + address_space.cpp + address_space.h + algorithm.h + alignment.h + announce_multiplayer_room.h + assert.cpp + assert.h + atomic_ops.h + bit_field.h + bit_util.h + bounded_threadsafe_queue.h + cityhash.cpp + cityhash.h + common_funcs.h + common_types.h + concepts.h + container_hash.h + demangle.cpp + demangle.h + detached_tasks.cpp + detached_tasks.h + device_power_state.cpp + device_power_state.h + div_ceil.h + dynamic_library.cpp + dynamic_library.h + elf.h + error.cpp + error.h + expected.h + fiber.cpp + fiber.h + fixed_point.h + free_region_manager.h + fs/file.cpp + fs/file.h + fs/fs.cpp + fs/fs.h + fs/fs_paths.h + fs/fs_types.h + fs/fs_util.cpp + fs/fs_util.h + fs/path_util.cpp + fs/path_util.h + hash.h + heap_tracker.cpp + heap_tracker.h + hex_util.cpp + hex_util.h + host_memory.cpp + host_memory.h + input.h + intrusive_red_black_tree.h + literals.h + logging/backend.cpp + logging/backend.h + logging/filter.cpp + logging/filter.h + logging/formatter.h + logging/log.h + logging/log_entry.h + logging/text_formatter.cpp + logging/text_formatter.h + logging/types.h + lz4_compression.cpp + lz4_compression.h + make_unique_for_overwrite.h + math_util.h + memory_detect.cpp + memory_detect.h + multi_level_page_table.cpp + multi_level_page_table.h + overflow.h + page_table.cpp + page_table.h + param_package.cpp + param_package.h + parent_of_member.h + point.h + quaternion.h + range_map.h + range_mutex.h + range_sets.h + range_sets.inc + ring_buffer.h + ${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp + scm_rev.h + scope_exit.h + scratch_buffer.h + settings.cpp + settings.h + settings_common.cpp + settings_common.h + settings_enums.h + settings_input.cpp + settings_input.h + settings_setting.h + slot_vector.h + socket_types.h + spin_lock.h + stb.cpp + stb.h + steady_clock.cpp + steady_clock.h + stream.cpp + stream.h + string_util.cpp + string_util.h + swap.h + thread.cpp + thread.h + thread_queue_list.h + thread_worker.h + threadsafe_queue.h + time_zone.cpp + time_zone.h + tiny_mt.h + tree.h + typed_address.h + uint128.h + unique_function.h + uuid.cpp + uuid.h + vector_math.h + virtual_buffer.cpp + virtual_buffer.h + wall_clock.cpp + wall_clock.h + zstd_compression.cpp + zstd_compression.h + fs/ryujinx_compat.h fs/ryujinx_compat.cpp + fs/symlink.h fs/symlink.cpp) if(WIN32) - target_sources(common PRIVATE windows/timer_resolution.cpp - windows/timer_resolution.h) - target_link_libraries(common PRIVATE ntdll) + target_sources(common PRIVATE windows/timer_resolution.cpp + windows/timer_resolution.h) + target_link_libraries(common PRIVATE ntdll) endif() if(NOT WIN32) - target_sources(common PRIVATE signal_chain.cpp signal_chain.h) + target_sources(common PRIVATE signal_chain.cpp signal_chain.h) endif() if(ANDROID) - target_sources( - common - PUBLIC fs/fs_android.cpp - fs/fs_android.h - android/android_common.cpp - android/android_common.h - android/id_cache.cpp - android/id_cache.h - android/multiplayer/multiplayer.cpp - android/multiplayer/multiplayer.h - android/applets/software_keyboard.cpp - android/applets/software_keyboard.h) + target_sources( + common + PUBLIC fs/fs_android.cpp + fs/fs_android.h + android/android_common.cpp + android/android_common.h + android/id_cache.cpp + android/id_cache.h + android/multiplayer/multiplayer.cpp + android/multiplayer/multiplayer.h + android/applets/software_keyboard.cpp + android/applets/software_keyboard.h) endif() if(ARCHITECTURE_x86_64) - target_sources( - common - PRIVATE x64/cpu_detect.cpp - x64/cpu_detect.h - x64/cpu_wait.cpp - x64/cpu_wait.h - x64/native_clock.cpp - x64/native_clock.h - x64/rdtsc.cpp - x64/rdtsc.h - x64/xbyak_abi.h - x64/xbyak_util.h) - target_link_libraries(common PRIVATE xbyak::xbyak) + target_sources( + common + PRIVATE x64/cpu_detect.cpp + x64/cpu_detect.h + x64/cpu_wait.cpp + x64/cpu_wait.h + x64/native_clock.cpp + x64/native_clock.h + x64/rdtsc.cpp + x64/rdtsc.h + x64/xbyak_abi.h + x64/xbyak_util.h) + target_link_libraries(common PRIVATE xbyak::xbyak) endif() if(HAS_NCE) - target_sources(common PRIVATE arm64/native_clock.cpp arm64/native_clock.h) + target_sources(common PRIVATE arm64/native_clock.cpp arm64/native_clock.h) endif() if(MSVC) - target_compile_definitions( - common - PRIVATE # The standard library doesn't provide any replacement for codecvt - # yet so we can disable this deprecation warning for the time being. - _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING) - target_compile_options( - common - PRIVATE /we4242 # 'identifier': conversion from 'type1' to 'type2', possible - # loss of data - /we4254 # 'operator': conversion from 'type1:field_bits' to - # 'type2:field_bits', possible loss of data - /we4800 # Implicit conversion from 'type' to bool. Possible - # information loss - ) + target_compile_definitions( + common + PRIVATE # The standard library doesn't provide any replacement for codecvt + # yet so we can disable this deprecation warning for the time being. + _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING) + target_compile_options( + common + PRIVATE /we4242 # 'identifier': conversion from 'type1' to 'type2', possible + # loss of data + /we4254 # 'operator': conversion from 'type1:field_bits' to + # 'type2:field_bits', possible loss of data + /we4800 # Implicit conversion from 'type' to bool. Possible + # information loss + ) else() - set_source_files_properties( - stb.cpp - PROPERTIES - COMPILE_OPTIONS - "-Wno-implicit-fallthrough;-Wno-missing-declarations;-Wno-missing-field-initializers") + set_source_files_properties( + stb.cpp + PROPERTIES + COMPILE_OPTIONS + "-Wno-implicit-fallthrough;-Wno-missing-declarations;-Wno-missing-field-initializers") - # Get around GCC failing with intrinsics in Debug - if(CXX_GCC AND CMAKE_BUILD_TYPE MATCHES "Debug") - set_property( - SOURCE stb.cpp - APPEND - PROPERTY COMPILE_OPTIONS ";-O2") - endif() + # Get around GCC failing with intrinsics in Debug + if(CXX_GCC AND CMAKE_BUILD_TYPE MATCHES "Debug") + set_property( + SOURCE stb.cpp + APPEND + PROPERTY COMPILE_OPTIONS ";-O2") + endif() endif() if(CXX_CLANG) - target_compile_options(common PRIVATE -fsized-deallocation - -Werror=unreachable-code-aggressive) - target_compile_definitions( - common - PRIVATE - # Clang 14 and earlier have errors when explicitly instantiating - # Settings::Setting - $<$,15>:CANNOT_EXPLICITLY_INSTANTIATE>) + target_compile_options(common PRIVATE -fsized-deallocation + -Werror=unreachable-code-aggressive) + target_compile_definitions( + common + PRIVATE + # Clang 14 and earlier have errors when explicitly instantiating + # Settings::Setting + $<$,15>:CANNOT_EXPLICITLY_INSTANTIATE>) endif() if (BOOST_NO_HEADERS) @@ -258,8 +257,8 @@ target_link_libraries(common PUBLIC fmt::fmt stb::headers Threads::Threads) target_link_libraries(common PRIVATE lz4::lz4 LLVM::Demangle zstd::zstd) if(ANDROID) - # For ASharedMemory_create - target_link_libraries(common PRIVATE android) + # For ASharedMemory_create + target_link_libraries(common PRIVATE android) endif() create_target_directory_groups(common) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index fda80938e4..81f98f1e5d 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1163,8 +1163,7 @@ add_library(core STATIC tools/freezer.cpp tools/freezer.h tools/renderdoc.cpp - tools/renderdoc.h -) + tools/renderdoc.h) if (ENABLE_WIFI_SCAN) # find_package(libiw REQUIRED) @@ -1194,8 +1193,7 @@ else() -Werror=conversion -Wno-sign-conversion -Wno-cast-function-type - $<$:-fsized-deallocation> - ) + $<$:-fsized-deallocation>) # pre-clang19 will spam with "OH DID YOU MEAN THIS?" otherwise... if (CXX_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19) target_compile_options(core PRIVATE -Wno-cast-function-type-mismatch) @@ -1211,7 +1209,13 @@ else() target_link_libraries(core PUBLIC Boost::headers) endif() -target_link_libraries(core PRIVATE fmt::fmt nlohmann_json::nlohmann_json RenderDoc::API MbedTLS::mbedcrypto${MBEDTLS_LIB_SUFFIX} MbedTLS::mbedtls${MBEDTLS_LIB_SUFFIX}) +target_link_libraries(core PRIVATE + fmt::fmt + nlohmann_json::nlohmann_json + RenderDoc::API + MbedTLS::mbedcrypto${MBEDTLS_LIB_SUFFIX} + MbedTLS::mbedtls${MBEDTLS_LIB_SUFFIX} + httplib::httplib) if (ENABLE_WEB_SERVICE) target_compile_definitions(core PUBLIC ENABLE_WEB_SERVICE) @@ -1233,8 +1237,7 @@ if (HAS_NCE) arm/nce/interpreter_visitor.h arm/nce/patcher.cpp arm/nce/patcher.h - arm/nce/visitor_base.h - ) + arm/nce/visitor_base.h) target_link_libraries(core PRIVATE merry::oaknut) endif() @@ -1254,8 +1257,7 @@ if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) hle/service/jit/jit_context.cpp hle/service/jit/jit_context.h hle/service/jit/jit.cpp - hle/service/jit/jit.h - ) + hle/service/jit/jit.h) target_link_libraries(core PRIVATE dynarmic::dynarmic) endif() @@ -1265,23 +1267,19 @@ if(ENABLE_OPENSSL) find_package(OpenSSL REQUIRED) - target_link_libraries(core PRIVATE OpenSSL::SSL OpenSSL::Crypto httplib::httplib) + target_link_libraries(core PRIVATE OpenSSL::SSL OpenSSL::Crypto) target_compile_definitions(core PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT) elseif (APPLE) target_sources(core PRIVATE hle/service/ssl/ssl_backend_securetransport.cpp) - target_link_libraries(core PRIVATE "-framework Security" httplib::httplib) + target_link_libraries(core PRIVATE "-framework Security") elseif (WIN32) target_sources(core PRIVATE hle/service/ssl/ssl_backend_schannel.cpp) target_link_libraries(core PRIVATE crypt32 secur32) - if (NOT MINGW) - target_link_libraries(core PRIVATE httplib::httplib) - endif() else() target_sources(core PRIVATE hle/service/ssl/ssl_backend_none.cpp) - target_link_libraries(core PRIVATE httplib::httplib) endif() create_target_directory_groups(core)