[cmake] enable clang-cl and WoA builds #348

Merged
crueter merged 31 commits from liz-clang-cl-cmake into master 2025-09-09 20:47:51 +02:00
6 changed files with 30 additions and 18 deletions
Showing only changes of commit b42d12ef6b - Show all commits

View file

@ -12,7 +12,8 @@ set(__windows_copy_files YES)
# Any number of files to copy from SOURCE_DIR to DEST_DIR can be specified after DEST_DIR.
# This copying happens post-build.
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
# windows commandline expects the / to be \ so switch them
string(REPLACE "/" "\\\\" SOURCE_DIR ${SOURCE_DIR})
string(REPLACE "/" "\\\\" DEST_DIR ${DEST_DIR})
@ -24,4 +25,12 @@ function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
COMMAND robocopy ${SOURCE_DIR} ${DEST_DIR} ${ARGN} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
)
endfunction()
endfunction()
else()
function(windows_copy_files TARGET SOURCE_DIR DEST_DIR)
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${DEST_DIR}
COMMAND cp -ra ${SOURCE_DIR}/. ${DEST_DIR}
)
endfunction()
endif()

View file

@ -14,7 +14,10 @@
"artifact": "%TAG%-cmake.7z",
"hash": "e5b049e5b61964480ca816395f63f95621e66cb9bcf616a8b10e441e0e69f129e22443acb11e77bc1e8170f8e4171b9b7719891efc43699782bfcd4b3a365f01",
"git_version": "1.88.0",
"version": "1.57"
"version": "1.57",
"patches": [
"0001-clang-cl.patch"
]
},
"fmt": {
"repo": "fmtlib/fmt",

View file

@ -20,7 +20,7 @@ namespace Common {
// This function multiplies 2 u64 values and divides it by a u64 value.
[[nodiscard]] static inline u64 MultiplyAndDivide64(u64 a, u64 b, u64 d) {
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(__clang__)
u128 r{};
r[0] = _umul128(a, b, &r[1]);
u64 remainder;
@ -41,7 +41,7 @@ namespace Common {
// This function multiplies 2 u64 values and produces a u128 value;
[[nodiscard]] static inline u128 Multiply64Into128(u64 a, u64 b) {
u128 result;
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(__clang__)
result[0] = _umul128(a, b, &result[1]);
#else
unsigned __int128 tmp = a;

View file

@ -24,7 +24,7 @@ constexpr auto PauseCycles = 100'000U;
} // Anonymous namespace
#ifdef _MSC_VER
#if defined(_MSC_VER) && !defined(__clang__)
__forceinline static void TPAUSE() {
static constexpr auto RequestC02State = 0U;
_tpause(RequestC02State, FencedRDTSC() + PauseCycles);

View file

@ -197,12 +197,12 @@ private:
struct VM {
static constexpr u32 YUZU_PAGESIZE{0x1000};
static constexpr u32 PAGE_SIZE_BITS{std::countr_zero(YUZU_PAGESIZE)};
static constexpr u32 PAGE_SIZE_BITS{std::countr_zero<u32>(YUZU_PAGESIZE)};
static constexpr u32 SUPPORTED_BIG_PAGE_SIZES{0x30000};
static constexpr u32 DEFAULT_BIG_PAGE_SIZE{0x20000};
u32 big_page_size{DEFAULT_BIG_PAGE_SIZE};
u32 big_page_size_bits{std::countr_zero(DEFAULT_BIG_PAGE_SIZE)};
u32 big_page_size_bits{std::countr_zero<u32>(DEFAULT_BIG_PAGE_SIZE)};
static constexpr u32 VA_START_SHIFT{10};
static constexpr u64 DEFAULT_VA_SPLIT{1ULL << 34};