etrombly / rust-crosscompile

docker for cross compiling rust gtk programs to windows
35 stars 6 forks source link

Allow crosscompilation of apps using cargo buildscripts with pkg-config deps #11

Open alejandro-rod opened 2 years ago

alejandro-rod commented 2 years ago

For apps using buildscripts to compile gresources as explained here, the docker image won't be able to compile the buildscript because of the setting of PKG_CONFIG_PATH variable. In this case, the buildscript (which is supposed to be built and run natively) will try to link against mingw dependencies. One possible solution that worked for me was setting TARGET_PKG_CONFIG_PATH environment var instead of PKG_CONFIG_PATH. Reference: https://github.com/rust-lang/pkg-config-rs#external-configuration-via-target-scoped-environment-variables