Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC: qt using auto-generated bindings #17270

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
branch = status-desktop
[submodule "vendor/nimqml"]
path = vendor/nimqml
url = https://github.com/status-im/nimqml.git
url = https://github.com/arnetheduck/nimqml-miqt-poc.git
branch = status-desktop
[submodule "vendor/uuids"]
path = vendor/uuids
url = https://github.com/pragmagic/uuids.git
Expand Down Expand Up @@ -119,3 +120,7 @@
url = https://github.com/nim-lang/checksums.git
ignore = untracked
branch = master
[submodule "vendor/nim-miqt-poc"]
path = vendor/nim-miqt-poc
url = https://github.com/arnetheduck/nim-miqt-poc
branch = status-desktop
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ ifneq ($(detected_OS),Windows)
else
QT5_PCFILEDIR := $(QT5_LIBDIR)/pkgconfig
endif
export PKG_CONFIG_PATH := "$(QT5_PCFILEDIR)"

# some manually installed Qt5 instances have wrong paths in their *.pc files, so we pass the right one to the linker here
ifeq ($(detected_OS),Darwin)
NIM_PARAMS += -L:"-framework Foundation -framework AppKit -framework Security -framework IOKit -framework CoreServices -framework LocalAuthentication"
Expand Down Expand Up @@ -561,7 +563,7 @@ endif
$(NIM_STATUS_CLIENT): NIM_PARAMS += $(RESOURCES_LAYOUT)
$(NIM_STATUS_CLIENT): $(NIM_SOURCES) | statusq dotherside check-qt-dir $(STATUSGO) $(STATUSKEYCARDGO) $(QRCODEGEN) $(FLEETS) rcc compile-translations deps
echo -e $(BUILD_MSG) "$@"
$(ENV_SCRIPT) nim c $(NIM_PARAMS) \
PKG_CONFIG_PATH="$(QT5_PCFILEDIR)" $(ENV_SCRIPT) nim c $(NIM_PARAMS) \
--mm:refc \
--passL:"-L$(STATUSGO_LIBDIR)" \
--passL:"-lstatus" \
Expand Down
6 changes: 5 additions & 1 deletion config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ elif defined(windows):
--tlsEmulation:off
switch("passL", "-Wl,-as-needed")
else:
switch("passL", "-fPIC")
switch("passC", "-fPIC")
switch("passC", "-fvisibility=hidden")

--dynlibOverrideAll # don't use dlopen()
# dynamically link these libs, since we're opting out of dlopen()
switch("passL", "-l:libcrypto.so.1.1")
Expand All @@ -56,7 +60,7 @@ switch("warning", "UnreachableElse:off")

# Those are popular to miss in our app, and quickly make build log unreadable, so we want to prevent them
switch("warningAsError", "UseBase:on")
switch("warningAsError", "UnusedImport:on")
#switch("warningAsError", "UnusedImport:on")
switch("warningAsError", "Deprecated:on")
switch("warningAsError", "HoleEnumConv:on")

Expand Down
3 changes: 3 additions & 0 deletions nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
gcc.linkerexe="g++"

path = "src"
path = "vendor/nim-miqt-poc/qt"
path = "vendor/nim-miqt-poc/qt/network"
path = "vendor/nim-miqt-poc/qt/quick"
1 change: 1 addition & 0 deletions vendor/nim-miqt-poc
Submodule nim-miqt-poc added at fa1df6