forked from eden-emu/eden
[cmake, core] Unbreak FreeBSD Building Process (#117)
During building eden on FreeBSD, it always assumed that FreeBSD due to being part of the unix family, has gamemode support, too. Since it doesn't the building process failed. This commit aims to fix that by separating out Unix and Linux for CMake to ensure there are no conflicts. Reviewed-on: eden-emu/eden#117 Co-authored-by: SDK-Chan <sdkchan@eden-emu.dev> Co-committed-by: SDK-Chan <sdkchan@eden-emu.dev>
This commit is contained in:
parent
b9c21a5c50
commit
87f171e884
3 changed files with 737 additions and 737 deletions
|
@ -1,214 +1,208 @@
|
||||||
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
|
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
if (DEFINED ENV{AZURECIREPO})
|
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project SPDX-License-Identifier:
|
||||||
|
# GPL-2.0-or-later
|
||||||
|
|
||||||
|
if(DEFINED ENV{AZURECIREPO})
|
||||||
set(BUILD_REPOSITORY $ENV{AZURECIREPO})
|
set(BUILD_REPOSITORY $ENV{AZURECIREPO})
|
||||||
endif()
|
endif()
|
||||||
if (DEFINED ENV{TITLEBARFORMATIDLE})
|
if(DEFINED ENV{TITLEBARFORMATIDLE})
|
||||||
set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE})
|
set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE})
|
||||||
endif ()
|
endif()
|
||||||
if (DEFINED ENV{TITLEBARFORMATRUNNING})
|
if(DEFINED ENV{TITLEBARFORMATRUNNING})
|
||||||
set(TITLE_BAR_FORMAT_RUNNING $ENV{TITLEBARFORMATRUNNING})
|
set(TITLE_BAR_FORMAT_RUNNING $ENV{TITLEBARFORMATRUNNING})
|
||||||
endif ()
|
endif()
|
||||||
if (DEFINED ENV{DISPLAYVERSION})
|
if(DEFINED ENV{DISPLAYVERSION})
|
||||||
set(DISPLAY_VERSION $ENV{DISPLAYVERSION})
|
set(DISPLAY_VERSION $ENV{DISPLAYVERSION})
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
include(GenerateSCMRev)
|
include(GenerateSCMRev)
|
||||||
|
|
||||||
add_library(common STATIC
|
add_library(
|
||||||
address_space.cpp
|
common STATIC
|
||||||
address_space.h
|
address_space.cpp
|
||||||
algorithm.h
|
address_space.h
|
||||||
alignment.h
|
algorithm.h
|
||||||
announce_multiplayer_room.h
|
alignment.h
|
||||||
assert.cpp
|
announce_multiplayer_room.h
|
||||||
assert.h
|
assert.cpp
|
||||||
atomic_helpers.h
|
assert.h
|
||||||
atomic_ops.h
|
atomic_helpers.h
|
||||||
bit_cast.h
|
atomic_ops.h
|
||||||
bit_field.h
|
bit_cast.h
|
||||||
bit_set.h
|
bit_field.h
|
||||||
bit_util.h
|
bit_set.h
|
||||||
bounded_threadsafe_queue.h
|
bit_util.h
|
||||||
cityhash.cpp
|
bounded_threadsafe_queue.h
|
||||||
cityhash.h
|
cityhash.cpp
|
||||||
common_funcs.h
|
cityhash.h
|
||||||
common_precompiled_headers.h
|
common_funcs.h
|
||||||
common_types.h
|
common_precompiled_headers.h
|
||||||
concepts.h
|
common_types.h
|
||||||
container_hash.h
|
concepts.h
|
||||||
demangle.cpp
|
container_hash.h
|
||||||
demangle.h
|
demangle.cpp
|
||||||
detached_tasks.cpp
|
demangle.h
|
||||||
detached_tasks.h
|
detached_tasks.cpp
|
||||||
device_power_state.cpp
|
detached_tasks.h
|
||||||
device_power_state.h
|
device_power_state.cpp
|
||||||
div_ceil.h
|
device_power_state.h
|
||||||
dynamic_library.cpp
|
div_ceil.h
|
||||||
dynamic_library.h
|
dynamic_library.cpp
|
||||||
elf.h
|
dynamic_library.h
|
||||||
error.cpp
|
elf.h
|
||||||
error.h
|
error.cpp
|
||||||
expected.h
|
error.h
|
||||||
fiber.cpp
|
expected.h
|
||||||
fiber.h
|
fiber.cpp
|
||||||
fixed_point.h
|
fiber.h
|
||||||
free_region_manager.h
|
fixed_point.h
|
||||||
fs/file.cpp
|
free_region_manager.h
|
||||||
fs/file.h
|
fs/file.cpp
|
||||||
fs/fs.cpp
|
fs/file.h
|
||||||
fs/fs.h
|
fs/fs.cpp
|
||||||
fs/fs_paths.h
|
fs/fs.h
|
||||||
fs/fs_types.h
|
fs/fs_paths.h
|
||||||
fs/fs_util.cpp
|
fs/fs_types.h
|
||||||
fs/fs_util.h
|
fs/fs_util.cpp
|
||||||
fs/path_util.cpp
|
fs/fs_util.h
|
||||||
fs/path_util.h
|
fs/path_util.cpp
|
||||||
hash.h
|
fs/path_util.h
|
||||||
heap_tracker.cpp
|
hash.h
|
||||||
heap_tracker.h
|
heap_tracker.cpp
|
||||||
hex_util.cpp
|
heap_tracker.h
|
||||||
hex_util.h
|
hex_util.cpp
|
||||||
host_memory.cpp
|
hex_util.h
|
||||||
host_memory.h
|
host_memory.cpp
|
||||||
input.h
|
host_memory.h
|
||||||
intrusive_red_black_tree.h
|
input.h
|
||||||
literals.h
|
intrusive_red_black_tree.h
|
||||||
logging/backend.cpp
|
literals.h
|
||||||
logging/backend.h
|
logging/backend.cpp
|
||||||
logging/filter.cpp
|
logging/backend.h
|
||||||
logging/filter.h
|
logging/filter.cpp
|
||||||
logging/formatter.h
|
logging/filter.h
|
||||||
logging/log.h
|
logging/formatter.h
|
||||||
logging/log_entry.h
|
logging/log.h
|
||||||
logging/text_formatter.cpp
|
logging/log_entry.h
|
||||||
logging/text_formatter.h
|
logging/text_formatter.cpp
|
||||||
logging/types.h
|
logging/text_formatter.h
|
||||||
lz4_compression.cpp
|
logging/types.h
|
||||||
lz4_compression.h
|
lz4_compression.cpp
|
||||||
make_unique_for_overwrite.h
|
lz4_compression.h
|
||||||
math_util.h
|
make_unique_for_overwrite.h
|
||||||
memory_detect.cpp
|
math_util.h
|
||||||
memory_detect.h
|
memory_detect.cpp
|
||||||
microprofile.cpp
|
memory_detect.h
|
||||||
microprofile.h
|
microprofile.cpp
|
||||||
microprofileui.h
|
microprofile.h
|
||||||
multi_level_page_table.cpp
|
microprofileui.h
|
||||||
multi_level_page_table.h
|
multi_level_page_table.cpp
|
||||||
nvidia_flags.cpp
|
multi_level_page_table.h
|
||||||
nvidia_flags.h
|
nvidia_flags.cpp
|
||||||
overflow.h
|
nvidia_flags.h
|
||||||
page_table.cpp
|
overflow.h
|
||||||
page_table.h
|
page_table.cpp
|
||||||
param_package.cpp
|
page_table.h
|
||||||
param_package.h
|
param_package.cpp
|
||||||
parent_of_member.h
|
param_package.h
|
||||||
point.h
|
parent_of_member.h
|
||||||
precompiled_headers.h
|
point.h
|
||||||
quaternion.h
|
precompiled_headers.h
|
||||||
range_map.h
|
quaternion.h
|
||||||
range_mutex.h
|
range_map.h
|
||||||
range_sets.h
|
range_mutex.h
|
||||||
range_sets.inc
|
range_sets.h
|
||||||
reader_writer_queue.h
|
range_sets.inc
|
||||||
ring_buffer.h
|
reader_writer_queue.h
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp
|
ring_buffer.h
|
||||||
scm_rev.h
|
${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp
|
||||||
scope_exit.h
|
scm_rev.h
|
||||||
scratch_buffer.h
|
scope_exit.h
|
||||||
settings.cpp
|
scratch_buffer.h
|
||||||
settings.h
|
settings.cpp
|
||||||
settings_common.cpp
|
settings.h
|
||||||
settings_common.h
|
settings_common.cpp
|
||||||
settings_enums.h
|
settings_common.h
|
||||||
settings_input.cpp
|
settings_enums.h
|
||||||
settings_input.h
|
settings_input.cpp
|
||||||
settings_setting.h
|
settings_input.h
|
||||||
slot_vector.h
|
settings_setting.h
|
||||||
socket_types.h
|
slot_vector.h
|
||||||
spin_lock.cpp
|
socket_types.h
|
||||||
spin_lock.h
|
spin_lock.cpp
|
||||||
stb.cpp
|
spin_lock.h
|
||||||
stb.h
|
stb.cpp
|
||||||
steady_clock.cpp
|
stb.h
|
||||||
steady_clock.h
|
steady_clock.cpp
|
||||||
stream.cpp
|
steady_clock.h
|
||||||
stream.h
|
stream.cpp
|
||||||
string_util.cpp
|
stream.h
|
||||||
string_util.h
|
string_util.cpp
|
||||||
swap.h
|
string_util.h
|
||||||
thread.cpp
|
swap.h
|
||||||
thread.h
|
thread.cpp
|
||||||
thread_queue_list.h
|
thread.h
|
||||||
thread_worker.h
|
thread_queue_list.h
|
||||||
threadsafe_queue.h
|
thread_worker.h
|
||||||
time_zone.cpp
|
threadsafe_queue.h
|
||||||
time_zone.h
|
time_zone.cpp
|
||||||
tiny_mt.h
|
time_zone.h
|
||||||
tree.h
|
tiny_mt.h
|
||||||
typed_address.h
|
tree.h
|
||||||
uint128.h
|
typed_address.h
|
||||||
unique_function.h
|
uint128.h
|
||||||
uuid.cpp
|
unique_function.h
|
||||||
uuid.h
|
uuid.cpp
|
||||||
vector_math.h
|
uuid.h
|
||||||
virtual_buffer.cpp
|
vector_math.h
|
||||||
virtual_buffer.h
|
virtual_buffer.cpp
|
||||||
wall_clock.cpp
|
virtual_buffer.h
|
||||||
wall_clock.h
|
wall_clock.cpp
|
||||||
zstd_compression.cpp
|
wall_clock.h
|
||||||
zstd_compression.h
|
zstd_compression.cpp
|
||||||
)
|
zstd_compression.h)
|
||||||
|
|
||||||
if (YUZU_ENABLE_PORTABLE)
|
if(YUZU_ENABLE_PORTABLE)
|
||||||
add_compile_definitions(YUZU_ENABLE_PORTABLE)
|
add_compile_definitions(YUZU_ENABLE_PORTABLE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if(WIN32)
|
||||||
target_sources(common PRIVATE
|
target_sources(common PRIVATE windows/timer_resolution.cpp
|
||||||
windows/timer_resolution.cpp
|
windows/timer_resolution.h)
|
||||||
windows/timer_resolution.h
|
|
||||||
)
|
|
||||||
target_link_libraries(common PRIVATE ntdll)
|
target_link_libraries(common PRIVATE ntdll)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT WIN32)
|
if(NOT WIN32)
|
||||||
target_sources(common PRIVATE
|
target_sources(common PRIVATE signal_chain.cpp signal_chain.h)
|
||||||
signal_chain.cpp
|
|
||||||
signal_chain.h
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
target_sources(common
|
target_sources(
|
||||||
PUBLIC
|
common
|
||||||
fs/fs_android.cpp
|
PUBLIC fs/fs_android.cpp
|
||||||
fs/fs_android.h
|
fs/fs_android.h
|
||||||
android/android_common.cpp
|
android/android_common.cpp
|
||||||
android/android_common.h
|
android/android_common.h
|
||||||
android/id_cache.cpp
|
android/id_cache.cpp
|
||||||
android/id_cache.h
|
android/id_cache.h
|
||||||
android/multiplayer/multiplayer.cpp
|
android/multiplayer/multiplayer.cpp
|
||||||
android/multiplayer/multiplayer.h
|
android/multiplayer/multiplayer.h
|
||||||
android/applets/software_keyboard.cpp
|
android/applets/software_keyboard.cpp
|
||||||
android/applets/software_keyboard.h
|
android/applets/software_keyboard.h)
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE)
|
if(LINUX AND NOT APPLE)
|
||||||
target_sources(common PRIVATE
|
target_sources(common PRIVATE linux/gamemode.cpp linux/gamemode.h)
|
||||||
linux/gamemode.cpp
|
|
||||||
linux/gamemode.h
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(common PRIVATE gamemode::headers)
|
target_link_libraries(common PRIVATE gamemode::headers)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ARCHITECTURE_x86_64)
|
if(ARCHITECTURE_x86_64)
|
||||||
target_sources(common
|
target_sources(
|
||||||
PRIVATE
|
common
|
||||||
x64/cpu_detect.cpp
|
PRIVATE x64/cpu_detect.cpp
|
||||||
x64/cpu_detect.h
|
x64/cpu_detect.h
|
||||||
x64/cpu_wait.cpp
|
x64/cpu_wait.cpp
|
||||||
x64/cpu_wait.h
|
x64/cpu_wait.h
|
||||||
|
@ -217,64 +211,69 @@ if(ARCHITECTURE_x86_64)
|
||||||
x64/rdtsc.cpp
|
x64/rdtsc.cpp
|
||||||
x64/rdtsc.h
|
x64/rdtsc.h
|
||||||
x64/xbyak_abi.h
|
x64/xbyak_abi.h
|
||||||
x64/xbyak_util.h
|
x64/xbyak_util.h)
|
||||||
)
|
target_link_libraries(common PRIVATE xbyak::xbyak)
|
||||||
target_link_libraries(common PRIVATE xbyak::xbyak)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (HAS_NCE)
|
if(HAS_NCE)
|
||||||
target_sources(common
|
target_sources(common PRIVATE arm64/native_clock.cpp arm64/native_clock.h)
|
||||||
PRIVATE
|
|
||||||
arm64/native_clock.cpp
|
|
||||||
arm64/native_clock.h
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if(MSVC)
|
||||||
target_compile_definitions(common PRIVATE
|
target_compile_definitions(
|
||||||
# The standard library doesn't provide any replacement for codecvt yet
|
common
|
||||||
# so we can disable this deprecation warning for the time being.
|
PRIVATE # The standard library doesn't provide any replacement for codecvt
|
||||||
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
# yet so we can disable this deprecation warning for the time being.
|
||||||
)
|
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING)
|
||||||
target_compile_options(common PRIVATE
|
target_compile_options(
|
||||||
/we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
common
|
||||||
/we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
|
PRIVATE /we4242 # 'identifier': conversion from 'type1' to 'type2', possible
|
||||||
/we4800 # Implicit conversion from 'type' to bool. Possible information loss
|
# 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()
|
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
|
# 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_property(
|
set_property(
|
||||||
SOURCE stb.cpp
|
SOURCE stb.cpp
|
||||||
APPEND
|
APPEND
|
||||||
PROPERTY COMPILE_OPTIONS ";-O2"
|
PROPERTY COMPILE_OPTIONS ";-O2")
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
target_compile_options(common PRIVATE
|
target_compile_options(common PRIVATE -fsized-deallocation
|
||||||
-fsized-deallocation
|
-Werror=unreachable-code-aggressive)
|
||||||
-Werror=unreachable-code-aggressive
|
target_compile_definitions(
|
||||||
)
|
common
|
||||||
target_compile_definitions(common PRIVATE
|
PRIVATE
|
||||||
# Clang 14 and earlier have errors when explicitly instantiating Settings::Setting
|
# Clang 14 and earlier have errors when explicitly instantiating
|
||||||
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,15>:CANNOT_EXPLICITLY_INSTANTIATE>
|
# Settings::Setting
|
||||||
|
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,15>:CANNOT_EXPLICITLY_INSTANTIATE>
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(common PUBLIC Boost::headers fmt::fmt microprofile stb::headers Threads::Threads)
|
target_link_libraries(common PUBLIC Boost::headers fmt::fmt microprofile
|
||||||
|
stb::headers Threads::Threads)
|
||||||
target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
|
target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd LLVM::Demangle)
|
||||||
|
|
||||||
if (ANDROID)
|
if(ANDROID)
|
||||||
# For ASharedMemory_create
|
# For ASharedMemory_create
|
||||||
target_link_libraries(common PRIVATE android)
|
target_link_libraries(common PRIVATE android)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (YUZU_USE_PRECOMPILED_HEADERS)
|
if(YUZU_USE_PRECOMPILED_HEADERS)
|
||||||
target_precompile_headers(common PRIVATE precompiled_headers.h)
|
target_precompile_headers(common PRIVATE precompiled_headers.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
create_target_directory_groups(common)
|
create_target_directory_groups(common)
|
||||||
|
|
1019
src/yuzu/main.cpp
1019
src/yuzu/main.cpp
File diff suppressed because it is too large
Load diff
|
@ -68,7 +68,7 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __unix__
|
#ifdef __linux__
|
||||||
#include "common/linux/gamemode.h"
|
#include "common/linux/gamemode.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -410,9 +410,7 @@ int main(int argc, char** argv) {
|
||||||
"While attempting to load the ROM requested, an error occurred. Please "
|
"While attempting to load the ROM requested, an error occurred. Please "
|
||||||
"refer to the Eden wiki for more information or the Eden discord for "
|
"refer to the Eden wiki for more information or the Eden discord for "
|
||||||
"additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}",
|
"additional help.\n\nError Code: {:04X}-{:04X}\nError Description: {}",
|
||||||
loader_id,
|
loader_id, error_id, static_cast<Loader::ResultStatus>(error_id));
|
||||||
error_id,
|
|
||||||
static_cast<Loader::ResultStatus>(error_id));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -447,7 +445,7 @@ int main(int argc, char** argv) {
|
||||||
exit(0);
|
exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
#ifdef __unix__
|
#ifdef __linux__
|
||||||
Common::Linux::StartGamemode();
|
Common::Linux::StartGamemode();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -462,7 +460,7 @@ int main(int argc, char** argv) {
|
||||||
void(system.Pause());
|
void(system.Pause());
|
||||||
system.ShutdownMainProcess();
|
system.ShutdownMainProcess();
|
||||||
|
|
||||||
#ifdef __unix__
|
#ifdef __linux__
|
||||||
Common::Linux::StopGamemode();
|
Common::Linux::StopGamemode();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue