Compare commits

..

2 Commits

Author SHA1 Message Date
lizzie 75b81ebf82 Fix license headers 2026-10-08 16:26:02 +00:00
lizzie daad38a7ae [cmake] Replace deprecated make_directory usage
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-10-08 16:23:38 +00:00
2 changed files with 29 additions and 21 deletions
+25 -20
View File
@@ -322,42 +322,47 @@ endif()
# Build/optimization presets
if (CXX_GCC OR CXX_CLANG)
# GCC/clang will -mtune=generic by default
if ("${YUZU_BUILD_PRESET}" STREQUAL "native")
add_compile_options(
$<$<COMPILE_LANGUAGE:C,CXX>:-march=native>
$<$<COMPILE_LANGUAGE:C,CXX>:-mtune=native>)
elseif (ARCHITECTURE_x86_64)
if (ARCHITECTURE_x86_64)
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
# Generic supports Pentium Pro instruction set and above
# TODO: if a value is unknown, pass that as march and mtune
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, v3, zen2, zen4, native")
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=x86-64>)
set(march x86-64)
set(mtune generic)
elseif (${YUZU_BUILD_PRESET} STREQUAL "v3")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=x86-64-v3>)
set(march x86-64-v3)
set(mtune generic)
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen2")
add_compile_options(
$<$<COMPILE_LANGUAGE:C,CXX>:-march=znver2>
$<$<COMPILE_LANGUAGE:C,CXX>:-mtune=znver4>)
set(march znver2)
set(mtune znver2)
elseif (${YUZU_BUILD_PRESET} STREQUAL "zen4")
add_compile_options(
$<$<COMPILE_LANGUAGE:C,CXX>:-march=znver4>
$<$<COMPILE_LANGUAGE:C,CXX>:-mtune=znver4>)
set(march znver4)
set(mtune znver4)
endif()
elseif(ARCHITECTURE_arm64)
# See https://gcc.gnu.org/onlinedocs/gcc/AArch64-Options.html
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, optimized, armv9, m1, native")
set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, optimized, armv9, native")
set(mtune generic)
if (${YUZU_BUILD_PRESET} STREQUAL "generic")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=armv8-a>)
set(march armv8-a)
elseif (${YUZU_BUILD_PRESET} STREQUAL "optimized")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=armv8.2-a+lse+rcpc>)
set(march armv8.2-a+lse+rcpc)
elseif (${YUZU_BUILD_PRESET} STREQUAL "armv9")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-march=armv9-a>)
elseif (${YUZU_BUILD_PRESET} STREQUAL "m1")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-mcpu=apple-m1>)
set(march armv9-a)
endif()
endif()
if ("${YUZU_BUILD_PRESET}" STREQUAL "native")
set(march native)
set(mtune native)
endif()
if (DEFINED march AND DEFINED mtune)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${march} -mtune=${mtune}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${march} -mtune=${mtune}")
endif()
endif()
# Configure C++ standard
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2020 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
@@ -28,5 +31,5 @@ endforeach()
STRING(REGEX REPLACE "{{SEMICOLON}}" ";" CONTENTS "${CONTENTS}")
get_filename_component(OUTPUT_DIR ${HEADER_FILE} DIRECTORY)
make_directory(${OUTPUT_DIR})
file(MAKE_DIRECTORY ${OUTPUT_DIR})
configure_file(${INPUT_FILE} ${HEADER_FILE} @ONLY)