Upgrade to Qt 6 (#130)
Why? Open Source Qt 5 will stop receiving updates rather sooner than later so it's worth switching to Qt 6 to remain compatible with modern systems. Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/130
This commit is contained in:
23
externals/CMakeLists.txt
vendored
23
externals/CMakeLists.txt
vendored
@@ -50,10 +50,31 @@ if ((ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) AND NOT TARGET dynarmic::dynarmi
|
||||
endif()
|
||||
|
||||
# getopt
|
||||
if (MSVC)
|
||||
include(CheckIncludeFile)
|
||||
check_include_file(getopt.h HAS_GETOPT)
|
||||
if (NOT HAS_GETOPT)
|
||||
message(STATUS "Using bundled getopt")
|
||||
add_subdirectory(getopt)
|
||||
endif()
|
||||
|
||||
# clang_rt_builtins
|
||||
check_c_source_compiles("
|
||||
#include <stdint.h>
|
||||
|
||||
volatile __uint128_t a = 100;
|
||||
volatile __uint128_t b = 2;
|
||||
|
||||
int main() {
|
||||
__uint128_t result = a / b;
|
||||
(void)result;
|
||||
return 0;
|
||||
}
|
||||
" HAVE_UDIVTI3)
|
||||
if(NOT HAVE_UDIVTI3)
|
||||
message(STATUS "Adding clang_rt_builtins due to missing __udivti3")
|
||||
add_subdirectory(clang_rt_builtins)
|
||||
endif()
|
||||
|
||||
# Glad
|
||||
add_subdirectory(glad)
|
||||
|
||||
|
||||
4
externals/clang_rt_builtins/CMakeLists.txt
vendored
Normal file
4
externals/clang_rt_builtins/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(clang_rt_builtins C)
|
||||
|
||||
add_library(clang_rt_builtins STATIC udivti3.c)
|
||||
36
externals/clang_rt_builtins/udivti3.c
vendored
Normal file
36
externals/clang_rt_builtins/udivti3.c
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
typedef unsigned __int128 tu_int;
|
||||
|
||||
tu_int __udivti3(tu_int a, tu_int b)
|
||||
{
|
||||
if (b == 0) {
|
||||
// Handle division by zero (could also trigger a fault)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (b > a) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int shift;
|
||||
for (shift = 0;; shift++) {
|
||||
if (shift >= 128) {
|
||||
break;
|
||||
}
|
||||
tu_int shifted_b = b << shift;
|
||||
if (shifted_b > a || (shifted_b >> shift) != b) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
shift--;
|
||||
|
||||
tu_int quotient = 0;
|
||||
for (; shift >= 0; shift--) {
|
||||
tu_int shifted_b = b << shift;
|
||||
if (shifted_b <= a) {
|
||||
quotient |= (tu_int) 1 << shift;
|
||||
a -= shifted_b;
|
||||
}
|
||||
}
|
||||
|
||||
return quotient;
|
||||
}
|
||||
4
externals/getopt/CMakeLists.txt
vendored
4
externals/getopt/CMakeLists.txt
vendored
@@ -1,7 +1,7 @@
|
||||
# SPDX-FileCopyrightText: 2015 Greg Wicks <gpwicks@email.wm.edu>
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
add_library(getopt
|
||||
add_library(getopt STATIC
|
||||
getopt.c
|
||||
getopt.h
|
||||
)
|
||||
@@ -9,4 +9,4 @@ add_library(getopt
|
||||
create_target_directory_groups(getopt)
|
||||
|
||||
target_compile_definitions(getopt PUBLIC STATIC_GETOPT)
|
||||
target_include_directories(getopt INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_include_directories(getopt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
Reference in New Issue
Block a user