[cmake] enable clang-cl and WoA builds (#348)
Compilation and CMake fixes for both Windows on ARM and clang-cl, meaning Windows can now be built on both MSVC and clang on both amd64 and aarch64. Compiling on clang is *dramatically* faster so this should be useful for CI. Co-authored-by: crueter <crueter@eden-emu.dev> Co-authored-by: crueter <crueter@crueter.xyz> Reviewed-on: #348 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
428f136a75
commit
9d2681ecc9
276 changed files with 973 additions and 1010 deletions
23
externals/CMakeLists.txt
vendored
23
externals/CMakeLists.txt
vendored
|
@ -63,7 +63,14 @@ if (mbedtls_ADDED)
|
|||
if (NOT MSVC)
|
||||
target_compile_options(mbedcrypto PRIVATE
|
||||
-Wno-unused-but-set-variable
|
||||
-Wno-string-concatenation)
|
||||
-Wno-string-concatenation
|
||||
)
|
||||
elseif(CXX_CLANG)
|
||||
foreach(TARGET mbedtls mbedcrypto mbedx509)
|
||||
target_compile_options(${TARGET} PRIVATE
|
||||
-w
|
||||
)
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -84,6 +91,8 @@ if(MSVC AND USE_CCACHE AND sirit_ADDED)
|
|||
list(FILTER _opts EXCLUDE REGEX "/Zi")
|
||||
list(APPEND _opts "/Z7")
|
||||
set_target_properties(sirit PROPERTIES COMPILE_OPTIONS "${_opts}")
|
||||
elseif(MSVC AND CXX_CLANG)
|
||||
target_compile_options(sirit PRIVATE -Wno-error=unused-command-line-argument)
|
||||
endif()
|
||||
|
||||
# httplib
|
||||
|
@ -136,8 +145,16 @@ add_subdirectory(nx_tzdb)
|
|||
# VMA
|
||||
AddJsonPackage(vulkan-memory-allocator)
|
||||
|
||||
if (VulkanMemoryAllocator_ADDED AND MSVC)
|
||||
target_compile_options(VulkanMemoryAllocator INTERFACE /wd4189)
|
||||
if (VulkanMemoryAllocator_ADDED)
|
||||
if (CXX_CLANG)
|
||||
target_compile_options(VulkanMemoryAllocator INTERFACE
|
||||
-Wno-unused-variable
|
||||
)
|
||||
elseif(MSVC)
|
||||
target_compile_options(VulkanMemoryAllocator INTERFACE
|
||||
/wd4189
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT TARGET LLVM::Demangle)
|
||||
|
|
31
externals/cpmfile.json
vendored
31
externals/cpmfile.json
vendored
|
@ -1,12 +1,9 @@
|
|||
{
|
||||
"mbedtls": {
|
||||
"repo": "Mbed-TLS/mbedtls",
|
||||
"sha": "8c88150ca1",
|
||||
"hash": "769ad1e94c570671071e1f2a5c0f1027e0bf6bcdd1a80ea8ac970f2c86bc45ce4e31aa88d6d8110fc1bed1de81c48bc624df1b38a26f8b340a44e109d784a966",
|
||||
"find_args": "MODULE",
|
||||
"patches": [
|
||||
"0001-cmake-version.patch"
|
||||
]
|
||||
"repo": "eden-emulator/mbedtls",
|
||||
"sha": "ce4f81f4a9",
|
||||
"hash": "f2e7f887651b28745e508149214d409fd7cfdb92cb94b4146b47ff1e0fc09e47143f203ac18e34c2c1814b5bd031d04c74828676c0d4342920a2ddb7fd35e9a5",
|
||||
"find_args": "MODULE"
|
||||
},
|
||||
"spirv-headers": {
|
||||
"package": "SPIRV-Headers",
|
||||
|
@ -29,18 +26,12 @@
|
|||
},
|
||||
"cpp-jwt": {
|
||||
"version": "1.4",
|
||||
"repo": "arun11299/cpp-jwt",
|
||||
"sha": "a54fa08a3b",
|
||||
"hash": "a90f7e594ada0c7e49d5ff9211c71097534e7742a8e44bf0851b0362642a7271d53f5d83d04eeaae2bad17ef3f35e09e6818434d8eaefa038f3d1f7359d0969a",
|
||||
"repo": "crueter/cpp-jwt",
|
||||
"sha": "9eaea6328f",
|
||||
"hash": "e237d92c59ebbf0dc8ac0bae3bc80340e1e9cf430e1c1c9638443001118e16de2b3e9036ac4b98105427667b0386d97831415170b68c432438dcad9ef8052de7",
|
||||
"find_args": "CONFIG",
|
||||
"options": [
|
||||
"CPP_JWT_BUILD_EXAMPLES OFF",
|
||||
"CPP_JWT_BUILD_TESTS OFF",
|
||||
"CPP_JWT_USE_VENDORED_NLOHMANN_JSON OFF"
|
||||
],
|
||||
"patches": [
|
||||
"0001-no-install.patch",
|
||||
"0002-missing-decl.patch"
|
||||
]
|
||||
},
|
||||
"vulkan-utility-headers": {
|
||||
|
@ -107,12 +98,6 @@
|
|||
"repo": "martinus/unordered_dense",
|
||||
"sha": "73f3cbb237",
|
||||
"hash": "c08c03063938339d61392b687562909c1a92615b6ef39ec8df19ea472aa6b6478e70d7d5e33d4a27b5d23f7806daf57fe1bacb8124c8a945c918c7663a9e8532",
|
||||
"find_args": "CONFIG",
|
||||
"options": [
|
||||
"UNORDERED_DENSE_INSTALL OFF"
|
||||
],
|
||||
"patches": [
|
||||
"0001-cmake.patch"
|
||||
]
|
||||
"find_args": "CONFIG"
|
||||
}
|
||||
}
|
||||
|
|
22
externals/sse2neon/sse2neon.h
vendored
22
externals/sse2neon/sse2neon.h
vendored
|
@ -183,7 +183,7 @@
|
|||
}
|
||||
|
||||
/* Compiler barrier */
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#define SSE2NEON_BARRIER() _ReadWriteBarrier()
|
||||
#else
|
||||
#define SSE2NEON_BARRIER() \
|
||||
|
@ -859,7 +859,7 @@ FORCE_INLINE uint64x2_t _sse2neon_vmull_p64(uint64x1_t _a, uint64x1_t _b)
|
|||
{
|
||||
poly64_t a = vget_lane_p64(vreinterpret_p64_u64(_a), 0);
|
||||
poly64_t b = vget_lane_p64(vreinterpret_p64_u64(_b), 0);
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
__n64 a1 = {a}, b1 = {b};
|
||||
return vreinterpretq_u64_p128(vmull_p64(a1, b1));
|
||||
#else
|
||||
|
@ -1770,7 +1770,7 @@ FORCE_INLINE void _mm_free(void *addr)
|
|||
FORCE_INLINE uint64_t _sse2neon_get_fpcr(void)
|
||||
{
|
||||
uint64_t value;
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
value = _ReadStatusReg(ARM64_FPCR);
|
||||
#else
|
||||
__asm__ __volatile__("mrs %0, FPCR" : "=r"(value)); /* read */
|
||||
|
@ -1780,7 +1780,7 @@ FORCE_INLINE uint64_t _sse2neon_get_fpcr(void)
|
|||
|
||||
FORCE_INLINE void _sse2neon_set_fpcr(uint64_t value)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
_WriteStatusReg(ARM64_FPCR, value);
|
||||
#else
|
||||
__asm__ __volatile__("msr FPCR, %0" ::"r"(value)); /* write */
|
||||
|
@ -2249,7 +2249,7 @@ FORCE_INLINE __m128 _mm_or_ps(__m128 a, __m128 b)
|
|||
FORCE_INLINE void _mm_prefetch(char const *p, int i)
|
||||
{
|
||||
(void) i;
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
switch (i) {
|
||||
case _MM_HINT_NTA:
|
||||
__prefetch2(p, 1);
|
||||
|
@ -4820,7 +4820,7 @@ FORCE_INLINE __m128i _mm_packus_epi16(const __m128i a, const __m128i b)
|
|||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_pause
|
||||
FORCE_INLINE void _mm_pause(void)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
__isb(_ARM64_BARRIER_SY);
|
||||
#else
|
||||
__asm__ __volatile__("isb\n");
|
||||
|
@ -5716,7 +5716,7 @@ FORCE_INLINE __m128d _mm_undefined_pd(void)
|
|||
#pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
#endif
|
||||
__m128d a;
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
a = _mm_setzero_pd();
|
||||
#endif
|
||||
return a;
|
||||
|
@ -8130,7 +8130,7 @@ FORCE_INLINE int _sse2neon_sido_negative(int res, int lb, int imm8, int bound)
|
|||
|
||||
FORCE_INLINE int _sse2neon_clz(unsigned int x)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
unsigned long cnt = 0;
|
||||
if (_BitScanReverse(&cnt, x))
|
||||
return 31 - cnt;
|
||||
|
@ -8142,7 +8142,7 @@ FORCE_INLINE int _sse2neon_clz(unsigned int x)
|
|||
|
||||
FORCE_INLINE int _sse2neon_ctz(unsigned int x)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
unsigned long cnt = 0;
|
||||
if (_BitScanForward(&cnt, x))
|
||||
return cnt;
|
||||
|
@ -9058,7 +9058,7 @@ FORCE_INLINE __m128i _mm_aeskeygenassist_si128(__m128i a, const int rcon)
|
|||
// AESE does ShiftRows and SubBytes on A
|
||||
uint8x16_t u8 = vaeseq_u8(vreinterpretq_u8_m128i(a), vdupq_n_u8(0));
|
||||
|
||||
#ifndef _MSC_VER
|
||||
#if !defined(_MSC_VER) || defined(__clang__)
|
||||
uint8x16_t dest = {
|
||||
// Undo ShiftRows step from AESE and extract X1 and X3
|
||||
u8[0x4], u8[0x1], u8[0xE], u8[0xB], // SubBytes(X1)
|
||||
|
@ -9245,7 +9245,7 @@ FORCE_INLINE uint64_t _rdtsc(void)
|
|||
* bits wide and it is attributed with the flag 'cap_user_time_short'
|
||||
* is true.
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
val = _ReadStatusReg(ARM64_SYSREG(3, 3, 14, 0, 2));
|
||||
#else
|
||||
__asm__ __volatile__("mrs %0, cntvct_el0" : "=r"(val));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue