Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
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
nanahira
ygopro-core
Commits
78edd60d
Commit
78edd60d
authored
Mar 20, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support wasm build
parent
8489cd62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
.gitignore
.gitignore
+2
-0
premake/dll.lua
premake/dll.lua
+17
-2
premake/lua.lua
premake/lua.lua
+8
-1
No files found.
.gitignore
View file @
78edd60d
...
@@ -7,3 +7,5 @@
...
@@ -7,3 +7,5 @@
/dll.lua
/dll.lua
/*.sh
/*.sh
/test-wasm
/wasm
premake/dll.lua
View file @
78edd60d
newoption
{
trigger
=
"lua-dir"
,
description
=
""
,
value
=
"PATH"
,
default
=
"./lua"
}
newoption
{
trigger
=
"lua-dir"
,
description
=
""
,
value
=
"PATH"
,
default
=
"./lua"
}
newoption
{
trigger
=
"wasm"
,
description
=
""
}
function
GetParam
(
param
)
function
GetParam
(
param
)
return
_OPTIONS
[
param
]
or
os.getenv
(
string.upper
(
string.gsub
(
param
,
"-"
,
"_"
)))
return
_OPTIONS
[
param
]
or
os.getenv
(
string.upper
(
string.gsub
(
param
,
"-"
,
"_"
)))
...
@@ -9,13 +10,19 @@ if not os.isdir(LUA_DIR) then
...
@@ -9,13 +10,19 @@ if not os.isdir(LUA_DIR) then
LUA_DIR
=
"../lua"
LUA_DIR
=
"../lua"
end
end
WASM
=
GetParam
(
"wasm"
)
workspace
"ocgcoredll"
workspace
"ocgcoredll"
location
"build"
location
"build"
language
"C++"
language
"C++"
cppdialect
"C++14"
cppdialect
"C++14"
configurations
{
"Release"
,
"Debug"
}
configurations
{
"Release"
,
"Debug"
}
platforms
{
"x32"
,
"x64"
}
if
WASM
then
toolset
"emcc"
platforms
{
"wasm"
}
else
platforms
{
"x32"
,
"x64"
}
end
filter
"platforms:x32"
filter
"platforms:x32"
architecture
"x32"
architecture
"x32"
...
@@ -61,6 +68,10 @@ workspace "ocgcoredll"
...
@@ -61,6 +68,10 @@ workspace "ocgcoredll"
defines
{
"LUA_USE_LINUX"
}
defines
{
"LUA_USE_LINUX"
}
buildoptions
{
"-fPIC"
}
buildoptions
{
"-fPIC"
}
filter
"system:emscripten"
defines
{
"LUA_USE_LONGJMP"
}
buildoptions
{
"-fPIC"
}
filter
{}
filter
{}
include
(
LUA_DIR
)
include
(
LUA_DIR
)
...
@@ -74,3 +85,7 @@ project "ocgcore"
...
@@ -74,3 +85,7 @@ project "ocgcore"
links
{
"lua"
}
links
{
"lua"
}
includedirs
{
LUA_DIR
..
"/src"
}
includedirs
{
LUA_DIR
..
"/src"
}
filter
"system:emscripten"
targetextension
".wasm"
linkoptions
{
"-s MODULARIZE=1"
,
"-s EXPORT_NAME=\"
createOcgcore
\
""
,
"--no-entry"
,
"-s EXPORTED_FUNCTIONS=[\"
_set_script_reader
\
",\"
_set_card_reader
\
",\"
_set_message_handler
\
",\"
_create_duel
\
",\"
_start_duel
\
",\"
_end_duel
\
",\"
_set_player_info
\
",\"
_get_log_message
\
",\"
_get_message
\
",\"
_process
\
",\"
_new_card
\
",\"
_new_tag_card
\
",\"
_query_card
\
",\"
_query_field_count
\
",\"
_query_field_card
\
",\"
_query_field_info
\
",\"
_set_responsei
\
",\"
_set_responseb
\
",\"
_preload_script
\
"]"
,
"-s ENVIRONMENT=web,node"
,
"-s EXPORTED_RUNTIME_METHODS=[\"
ccall
\
",\"
cwrap
\
",\"
addFunction
\
",\"
removeFunction
\
"]"
,
"-s ALLOW_TABLE_GROWTH=1"
,
"-s ALLOW_MEMORY_GROWTH=1"
,
"-o ../wasm/ocgcore.js"
}
premake/lua.lua
View file @
78edd60d
project
"lua"
project
"lua"
kind
"StaticLib"
kind
"StaticLib"
compileas
"C++"
compileas
"C++"
if
WASM
then
toolset
"emcc"
end
files
{
"src/*.c"
,
"src/*.h"
}
files
{
"src/*.c"
,
"src/*.h"
}
removefiles
{
"src/lua.c"
,
"src/luac.c"
,
"src/linit.c"
,
"src/onelua.c"
}
removefiles
{
"src/lua.c"
,
"src/luac.c"
,
"src/onelua.c"
}
if
not
GetParam
(
"no-lua-safe"
)
then
removefiles
{
"src/linit.c"
}
end
filter
"configurations:Debug"
filter
"configurations:Debug"
defines
{
"LUA_USE_APICHECK"
}
defines
{
"LUA_USE_APICHECK"
}
...
...
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