Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YGOPRO-520DIY
ygopro
Commits
dca5e5b4
Commit
dca5e5b4
authored
Apr 03, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add optimization for arm
parent
931e4fc4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
12 deletions
+79
-12
.ci/build-opus.sh
.ci/build-opus.sh
+1
-1
.ci/pack-linux-dlc.sh
.ci/pack-linux-dlc.sh
+2
-2
.ci/pack-linux.sh
.ci/pack-linux.sh
+2
-2
.gitlab-ci.yml
.gitlab-ci.yml
+4
-2
premake5.lua
premake5.lua
+70
-5
No files found.
.ci/build-opus.sh
View file @
dca5e5b4
...
...
@@ -22,7 +22,7 @@ build_single_thing() {
cd
"external/
$lib_name
"
shift
maybe_patch_configure
PKG_CONFIG_PATH
=
"
$external_built_dir
/lib/pkgconfig"
./configure
--prefix
=
"
$external_built_dir
"
--enable-static
=
yes
--enable-shared
=
no
"
$@
"
PKG_CONFIG_PATH
=
"
$external_built_dir
/lib/pkgconfig"
CFLAGS
=
"
$OPUS_FLAGS
"
CXXFLAGS
=
"
$OPUS_FLAGS
"
./configure
--prefix
=
"
$external_built_dir
"
--enable-static
=
yes
--enable-shared
=
no
"
$@
"
make
-j
$(
nproc
)
make
install
cd
../..
...
...
.ci/pack-linux-dlc.sh
View file @
dca5e5b4
...
...
@@ -8,9 +8,9 @@ if [[ -z "$TARGET_PLATFORM" ]]; then
TARGET_PLATFORM
=
linux
fi
if
[[
"
$TARGET_PLATFORM
"
!=
"linuxarm"
]]
;
then
#
if [[ "$TARGET_PLATFORM" != "linuxarm" ]]; then
ARCHIVE_FILES+
=(
sound
)
fi
#
fi
apt update
&&
apt
-y
install tar
zstd
mkdir
dist replay
...
...
.ci/pack-linux.sh
View file @
dca5e5b4
...
...
@@ -10,9 +10,9 @@ if [[ -z "$TARGET_PLATFORM" ]]; then
TARGET_PLATFORM
=
linux
fi
if
[[
"
$TARGET_PLATFORM
"
!=
"linuxarm"
]]
;
then
#
if [[ "$TARGET_PLATFORM" != "linuxarm" ]]; then
ARCHIVE_FILES+
=(
sound
)
fi
#
fi
apt update
&&
apt
-y
install tar
git zstd
mkdir
dist replay
...
...
.gitlab-ci.yml
View file @
dca5e5b4
...
...
@@ -160,6 +160,8 @@ exec_linuxarm:
extends
:
.exec_linux
tags
:
-
arm
variables
:
OPUS_FLAGS
:
'
-fFPIC'
# force position independent code for arm
._exec_macos_platform
:
extends
:
._exec_build
...
...
@@ -183,8 +185,8 @@ exec_macos_platform_m1:
extends
:
._exec_macos_platform
tags
:
-
macos-m1
variables
:
MAC_ARM
:
1
#
variables:
#
MAC_ARM: 1
exec_macos
:
stage
:
combine
...
...
premake5.lua
View file @
dca5e5b4
...
...
@@ -271,13 +271,70 @@ end
if
GetParam
(
"winxp-support"
)
and
os
.
istarget
(
"windows"
)
then
WINXP_SUPPORT
=
true
end
if
os
.
istarget
(
"macosx"
)
then
MAC_ARM
=
false
if
GetParam
(
"mac-arm"
)
then
MAC_ARM
=
true
IS_ARM
=
false
function
spawn
(
cmd
)
local
handle
=
io.popen
(
cmd
)
if
not
handle
then
return
nil
end
local
result
=
handle
:
read
(
"*a"
)
handle
:
close
()
if
result
and
#
result
>
0
then
return
result
else
return
nil
end
end
function
isRunningUnderRosetta
()
local
rosetta_result
=
spawn
(
"sysctl -n sysctl.proc_translated 2>/dev/null"
)
return
rosetta_result
=
(
tonumber
(
rosetta_result
)
==
1
)
end
function
IsRunningUnderARM
()
-- os.hostarch() is over premake5 beta3,
if
os
.
hostarch
then
local
host_arch
=
os
.
hostarch
()
local
possible_archs
=
{
"ARM"
,
"ARM64"
,
"loongarch64"
,
"armv5"
,
"armv7"
,
"aarch64"
}
for
_
,
arch
in
ipairs
(
possible_archs
)
do
if
host_arch
:
lower
():
match
(
arch
:
lower
())
then
return
true
end
end
else
-- use command 'arch' to detect the architecture on macOS or Linux
local
arch_result
=
spawn
(
"arch 2>/dev/null"
)
if
arch_result
then
arch_result
=
arch_result
:
lower
():
gsub
(
"%s+"
,
""
)
if
arch_result
==
"arm64"
or
arch_result
==
"aarch64"
then
return
true
elseif
arch_result
==
"arm"
or
arch_result
==
"armv7"
or
arch_result
==
"armv5"
then
return
true
-- for ARMv5, ARMv7, etc.
elseif
arch_result
==
"loongarch64"
then
return
true
-- for loongarch64
end
end
end
return
false
end
function
isARM
()
if
IsRunningUnderARM
()
then
return
true
end
if
os
.
istarget
(
"macosx"
)
and
isRunningUnderRosetta
()
then
-- macOS under rosetta will report x86_64, but it is running on ARM
print
(
"Detected running under Rosetta on macOS, treating as ARM"
)
return
true
end
return
false
end
IS_ARM
=
isARM
()
or
GetParam
(
"mac-arm"
)
-- detect if the current system is ARM
MAC_ARM
=
os
.
istarget
(
"macosx"
)
and
IS_ARM
workspace
"YGOPro"
location
"build"
language
"C++"
...
...
@@ -339,9 +396,17 @@ workspace "YGOPro"
filter
{
"configurations:Release"
,
"not action:vs*"
}
symbols
"On"
defines
"NDEBUG"
if
not
MAC
_ARM
then
if
not
IS
_ARM
then
buildoptions
"-march=native"
end
if
IS_ARM
and
not
MAC_ARM
then
buildoptions
{
"-march=armv8-a"
,
"-mtune=cortex-a72"
,
"-fPIC"
,
"-Wno-psabi"
}
end
filter
{
"configurations:Debug"
,
"action:vs*"
}
disablewarnings
{
"6011"
,
"6031"
,
"6054"
,
"6262"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment