c0re100 / qBittorrent-Enhanced-Edition

[Unofficial] qBittorrent Enhanced, based on qBittorrent
https://github.com/c0re100/qBittorrent-Enhanced-Edition
Other
19.84k stars 1.27k forks source link

Not able to cross compile on macOS #580

Closed Sheng-Horizon closed 2 months ago

Sheng-Horizon commented 4 months ago

qBittorrent & operating system versions

Operating system: macOS 14.4 apple silicon Qt: 5.15.2 qBittorrent-Enhanced-Edition: 4.6.5.10 libtorrent-rasterbar: 2.0.10

What is the problem?

I've tried to cross compile for x86_64-unknown-linux-musl on macOS. However, it seems that some of the command-line options for macOS still exists. Sorry in advance if I did something wrong.

Last login: Sun Jul 28 11:26:26 on ttys002
➜  qBittorrent-Enhanced-Edition-release-4.6.5.10   export LDFLAGS="-L/usr/local/opt/qt@5/lib"
  export CPPFLAGS="-I/usr/local/opt/qt@5/include"
➜  qBittorrent-Enhanced-Edition-release-4.6.5.10   export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig"
➜  qBittorrent-Enhanced-Edition-release-4.6.5.10 ./configure --disable-gui --host=x86_64-unknown-linux-musl
checking for x86_64-unknown-linux-musl-gcc... x86_64-unknown-linux-musl-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether x86_64-unknown-linux-musl-gcc accepts -g... yes
checking for x86_64-unknown-linux-musl-gcc option to enable C11 features... none needed
checking whether x86_64-unknown-linux-musl-gcc understands -c and -o together... yes
checking for x86_64-unknown-linux-musl-g++... x86_64-unknown-linux-musl-g++
checking whether the compiler supports GNU C++... yes
checking whether x86_64-unknown-linux-musl-g++ accepts -g... yes
checking for x86_64-unknown-linux-musl-g++ option to enable C++11 features... none needed
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking build system type... arm-apple-darwin23.4.0
checking host system type... x86_64-unknown-linux-musl
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for x86_64-unknown-linux-musl-strip... x86_64-unknown-linux-musl-strip
checking for a race-free mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of x86_64-unknown-linux-musl-gcc... none
checking dependency style of x86_64-unknown-linux-musl-g++... none
checking whether to enable specific tweaks for current host "linux-musl"... no
checking for x86_64-unknown-linux-musl-pkg-config... no
checking for pkg-config... /usr/local/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.23... yes
checking whether to enable the Debug build... no
checking whether to enable the stacktrace feature... no
checking whether to enable the GUI... no
checking whether to install the systemd service file... no
checking whether to enable the WebUI... yes
checking for Qt5 qmake >= 5.15.2... /usr/local/Cellar/qt@5/5.15.13_1/bin/qmake
checking whether QtDBus should be enabled... no
checking for boostlib >= 1.71 (107100)... yes
configure: Boost CXXFLAGS: "-I/usr/local/include"
configure: Boost LDFLAGS: "-L/usr/local/lib/x86_64-linux-musl"
checking for libtorrent-rasterbar >= 2.0.9... yes
checking for openssl >= 1.1.1... yes
checking for zlib >= 1.2.11... yes
checking if compiler defaults to C++17 or later mode... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating conf.pri
config.status: executing depfiles commands
configure: Running qmake to generate the makefile...
Info: creating stash file /Users/rogerlu/Downloads/qBittorrent-Enhanced-Edition-release-4.6.5.10/.qmake.stash
Reading /Users/rogerlu/Downloads/qBittorrent-Enhanced-Edition-release-4.6.5.10/src/src.pro
Project MESSAGE: Project is built in RELEASE mode.
Project MESSAGE: Disabling debug output.
Project WARNING: Qt has only been tested with version 12 of the platform SDK, you're using 14.
Project WARNING: This is an unsupported configuration. You may experience build issues, and by using
Project WARNING: the 14.4 SDK you are opting in to new features that Qt has not been prepared for.
Project WARNING: Please downgrade the SDK you use to build your app to version 12, or configure
Project WARNING: with CONFIG+=sdk_no_version_check when running qmake to silence this warning.
Project MESSAGE: This project is using private headers and will therefore be tied to this specific Qt module build version.
Project MESSAGE: Running this project against other versions of the Qt modules may crash at any arbitrary point.
Project MESSAGE: This is not a bug, but a result of using Qt internals. You have been warned!

configure: Good, the configure finished.

➜  qBittorrent-Enhanced-Edition-release-4.6.5.10 make
cd src/ && ( test -e Makefile || /usr/local/Cellar/qt@5/5.15.13_1/bin/qmake -o Makefile /Users/rogerlu/Downloads/qBittorrent-Enhanced-Edition-release-4.6.5.10/src/src.pro QMAKE_LRELEASE= ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
lrelease webui/www/translations/webui_ar.ts
lrelease webui/www/translations/webui_az@latin.ts
lrelease webui/www/translations/webui_be.ts
lrelease webui/www/translations/webui_bg.ts
lrelease webui/www/translations/webui_ca.ts
lrelease webui/www/translations/webui_cs.ts
lrelease webui/www/translations/webui_da.ts
lrelease webui/www/translations/webui_de.ts
lrelease webui/www/translations/webui_el.ts
lrelease webui/www/translations/webui_en.ts
lrelease webui/www/translations/webui_en_AU.ts
lrelease webui/www/translations/webui_en_GB.ts
lrelease webui/www/translations/webui_eo.ts
lrelease webui/www/translations/webui_es.ts
lrelease webui/www/translations/webui_et.ts
lrelease webui/www/translations/webui_eu.ts
lrelease webui/www/translations/webui_fa.ts
lrelease webui/www/translations/webui_fi.ts
lrelease webui/www/translations/webui_fr.ts
lrelease webui/www/translations/webui_gl.ts
lrelease webui/www/translations/webui_he.ts
lrelease webui/www/translations/webui_hi_IN.ts
lrelease webui/www/translations/webui_hr.ts
lrelease webui/www/translations/webui_hu.ts
lrelease webui/www/translations/webui_hy.ts
lrelease webui/www/translations/webui_id.ts
lrelease webui/www/translations/webui_is.ts
lrelease webui/www/translations/webui_it.ts
lrelease webui/www/translations/webui_ja.ts
lrelease webui/www/translations/webui_ka.ts
lrelease webui/www/translations/webui_ko.ts
lrelease webui/www/translations/webui_lt.ts
lrelease webui/www/translations/webui_ltg.ts
lrelease webui/www/translations/webui_lv_LV.ts
lrelease webui/www/translations/webui_mn_MN.ts
lrelease webui/www/translations/webui_ms_MY.ts
lrelease webui/www/translations/webui_nb.ts
lrelease webui/www/translations/webui_nl.ts
lrelease webui/www/translations/webui_oc.ts
lrelease webui/www/translations/webui_pl.ts
lrelease webui/www/translations/webui_pt_BR.ts
lrelease webui/www/translations/webui_pt_PT.ts
lrelease webui/www/translations/webui_ro.ts
lrelease webui/www/translations/webui_ru.ts
lrelease webui/www/translations/webui_sk.ts
lrelease webui/www/translations/webui_sl.ts
lrelease webui/www/translations/webui_sr.ts
lrelease webui/www/translations/webui_sv.ts
lrelease webui/www/translations/webui_th.ts
lrelease webui/www/translations/webui_tr.ts
lrelease webui/www/translations/webui_uk.ts
lrelease webui/www/translations/webui_uz@Latn.ts
lrelease webui/www/translations/webui_vi.ts
lrelease webui/www/translations/webui_zh_CN.ts
lrelease webui/www/translations/webui_zh_HK.ts
lrelease webui/www/translations/webui_zh_TW.ts
lrelease lang/qbittorrent_ar.ts
lrelease lang/qbittorrent_az@latin.ts
lrelease lang/qbittorrent_be.ts
lrelease lang/qbittorrent_bg.ts
lrelease lang/qbittorrent_ca.ts
lrelease lang/qbittorrent_cs.ts
lrelease lang/qbittorrent_da.ts
lrelease lang/qbittorrent_de.ts
lrelease lang/qbittorrent_el.ts
lrelease lang/qbittorrent_en.ts
lrelease lang/qbittorrent_en_AU.ts
lrelease lang/qbittorrent_en_GB.ts
lrelease lang/qbittorrent_eo.ts
lrelease lang/qbittorrent_es.ts
lrelease lang/qbittorrent_et.ts
lrelease lang/qbittorrent_eu.ts
lrelease lang/qbittorrent_fa.ts
lrelease lang/qbittorrent_fi.ts
lrelease lang/qbittorrent_fr.ts
lrelease lang/qbittorrent_gl.ts
lrelease lang/qbittorrent_he.ts
lrelease lang/qbittorrent_hi_IN.ts
lrelease lang/qbittorrent_hr.ts
lrelease lang/qbittorrent_hu.ts
lrelease lang/qbittorrent_hy.ts
lrelease lang/qbittorrent_id.ts
lrelease lang/qbittorrent_is.ts
lrelease lang/qbittorrent_it.ts
lrelease lang/qbittorrent_ja.ts
lrelease lang/qbittorrent_ka.ts
lrelease lang/qbittorrent_ko.ts
lrelease lang/qbittorrent_lt.ts
lrelease lang/qbittorrent_ltg.ts
lrelease lang/qbittorrent_lv_LV.ts
lrelease lang/qbittorrent_mn_MN.ts
lrelease lang/qbittorrent_ms_MY.ts
lrelease lang/qbittorrent_nb.ts
lrelease lang/qbittorrent_nl.ts
lrelease lang/qbittorrent_oc.ts
lrelease lang/qbittorrent_pl.ts
lrelease lang/qbittorrent_pt_BR.ts
lrelease lang/qbittorrent_pt_PT.ts
lrelease lang/qbittorrent_ro.ts
lrelease lang/qbittorrent_ru.ts
lrelease lang/qbittorrent_sk.ts
lrelease lang/qbittorrent_sl.ts
lrelease lang/qbittorrent_sr.ts
lrelease lang/qbittorrent_sv.ts
lrelease lang/qbittorrent_th.ts
lrelease lang/qbittorrent_tr.ts
lrelease lang/qbittorrent_uk.ts
lrelease lang/qbittorrent_uz@Latn.ts
lrelease lang/qbittorrent_vi.ts
lrelease lang/qbittorrent_zh_CN.ts
lrelease lang/qbittorrent_zh_HK.ts
lrelease lang/qbittorrent_zh_TW.ts
compiling app/application.cpp
x86_64-unknown-linux-musl-g++: error: unrecognized command-line option '-stdlib=libc++'
x86_64-unknown-linux-musl-g++: error: unrecognized command-line option '-arch'
x86_64-unknown-linux-musl-g++: error: unrecognized command-line option '-mmacosx-version-min=10.15'
make[1]: *** [application.o] Error 1
make: *** [sub-src-make_first] Error 2

Steps to reproduce

  1. Download cross compile toolchains
  2. Cross compile.

Additional context

No response

Log(s) & preferences file(s)

No response

abcfy2 commented 4 months ago

I think you'd better use docker to build.