Skip to content

Commit 3d09114

Browse files
committed
emsc: wip
1 parent f03757f commit 3d09114

4 files changed

Lines changed: 38 additions & 11 deletions

File tree

.vscode/tasks.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@
5757
"group": "build"
5858
},
5959
{
60-
"label": "run-app-dbg-ogles2",
60+
"label": "run-app-dbg-ogles",
6161
"type": "shell",
62-
"command": "make run-app config=dbg ogles2=true",
62+
"command": "make run-app config=dbg ogles=true",
6363
"problemMatcher": [],
6464
"group": "build"
6565
},
6666
{
67-
"label": "run-app-dbg-ogles2-wayland",
67+
"label": "run-app-dbg-ogles-wayland",
6868
"type": "shell",
69-
"command": "WAYLAND_DISPLAY=$(ls /run/user/$UID/ | grep wayland-[0-9]$) make run-app config=dbg ogles2=true wayland=true",
69+
"command": "WAYLAND_DISPLAY=$(ls /run/user/$UID/ | grep wayland-[0-9]$) make run-app config=dbg ogles=true wayland=true",
7070
"problemMatcher": [],
7171
"group": "build"
7272
},

build/emscripten/conanfile.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[requires]
2+
ruis/[>=0.5.270]@cppfw/main
3+
papki/[>=0.0.0]@cppfw/main
4+
ruis-render-opengles/[>=0.1.70]@cppfw/main
5+
6+
[tool_requires]
7+
prorab/[>=2.0.27]@cppfw/main
8+
prorab-extra/[>=0.2.57]@cppfw/main
9+
10+
[generators]
11+
AutotoolsDeps

config/emsc.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ this_cxx := em++
66
this_cc := emcc
77
this_ar := emar
88

9-
this_static_lib_only = : true
9+
this_static_lib_only := true
1010

1111
# TODO: remove the warning suppression when the PR is merged
1212
# Suppress version-check warning due to https://github.com/conan-io/conan-center-index/pull/26247
@@ -19,3 +19,4 @@ this_cxxflags += -pthread
1919
this_ldflags += -pthread
2020

2121
this_cxxflags += --use-port=sdl2
22+
this_ldflags += --use-port=sdl2

tests/app/makefile

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,22 @@ ifeq ($(os),linux)
1818
this__backend := xorg
1919
endif
2020

21-
this__cfg_suffix := $(if $(ogles2),opengles,opengl)-$(this__backend)
22-
this_libruisapp := libruisapp-$(this__cfg_suffix)
21+
this__cfg_suffix := $(if $(ogles),opengles,opengl)-$(this__backend)
22+
this__libruisapp := libruisapp-$(this__cfg_suffix)
2323
else
24-
this__cfg_suffix := $(if $(ogles2),opengles,opengl)
25-
this_libruisapp := libruisapp-opengl
24+
this__cfg_suffix := $(if $(ogles),opengles,opengl)
25+
this__libruisapp := libruisapp-opengl
2626
endif
2727

28-
this_libruisapp := ../../src/out/$(c)/$(this__cfg_suffix)/$(this_libruisapp)$(dot_so)
28+
this__libruisapp := ../../src/out/$(c)/$(this__cfg_suffix)/$(this__libruisapp)
2929

30-
this_ldlibs += $(this_libruisapp)
30+
ifeq ($(config), emsc)
31+
this__libruisapp := $(this__libruisapp).a
32+
else
33+
this__libruisapp := $(this__libruisapp)$(dot_so)
34+
endif
35+
36+
this_ldlibs += $(this__libruisapp)
3137

3238
ifeq ($(os),windows)
3339
this_ldlibs += -lmingw32 # these should go first, otherwise linker will complain about undefined reference to WinMain
@@ -51,3 +57,12 @@ this_test_ld_path := ../../src/out/$(c)/$(this__cfg_suffix)/
5157
$(eval $(prorab-run))
5258

5359
$(eval $(call prorab-include, ../../src/makefile))
60+
61+
# targets for building with conan and emscripten
62+
63+
define this__rules
64+
conan_install:
65+
$(.RECIPEPREFIX)@echo install conan dependencies
66+
$(.RECIPEPREFIX)$(a)conan install $(d)../../build/emscripten --update --profile:host $(d)../../build/emscripten/conan.profile --build=missing --output-folder=$(d)out/emsc
67+
endef
68+
$(eval $(this__rules))

0 commit comments

Comments
 (0)