Hi,

I am using nimble and I am trying to get cross compiling working using the 
following script that I found on stackoverflow, based on a debian docker 
container:
    
    
    #!/bin/bash
    mkdir -p /workdir/windows
    cp -Rp * /workdir/windows/
    rm -rf /workdir/windows/src/nimcache
    cd /workdir/windows
    
    nim c --cpu:amd64 --os:windows --opt:speed --embedsrc --threads:on 
--checks:on -c -d:release src/*.nim
    cd src
    cp /opt/Nim/lib/nimbase.h nimcache/
    x86_64-w64-mingw32-gcc --save-temps nimcache/*.c -o windows.exe
    
    
    Run

That works absolutely fine, however, adding a new requires to project.nimble: 
    
    
    # Package
    
    version       = "0.1.0"
    author        = "Colin Yates"
    description   = "Chain Breaker"
    license       = "MIT"
    srcDir        = "src"
    bin           = @["chainbreaker"]
    
    # Dependencies
    
    requires "nim >= 0.18.0"
    requires "zip" # NEW LIB
    
    
    Run

breaks the gcc step because the dependant nim files (in 
~/.nimble/pkgs/zip/...~) don't appears to be compiled.

nim compilation works but the mingw32-gcc fails because it can't find the zip 
source files.

To be explicit, nimble build works fine, but obviously only builds for the 
current platform.

I am not sure if idiomatic cross-compilation means teaching nimble about 
platform specific stuff, or teaching nim to also include the ~/.nimble/pkgs/.

Help :-).

Reply via email to