Giter Club home page Giter Club logo

Comments (3)

GoWind avatar GoWind commented on May 23, 2024

I see , commit introduced this change. perhaps this should be src/main.zig ?

from capy.

zenith391 avatar zenith391 commented on May 23, 2024

Ah yes, I changed the way zgt should be installed. I'll change the instructions on the README very soon.
Meanwhile, like in zgt-template zgt must be added in build_dependencies, for simplicity you can just copy the file to your zigmod.yml.
After running zigmod fetch, add those lines in your build.zig (put them before exe.install()!):

const pathToZgt = ".zigmod/deps/git/github.com/zenith391/zgt/";
try deps.imports.zgt.install(exe, pathToZgt);

And then it should work!

The reason, I changed the way its done is because zgt needs to copy some files and link specific objects when compiling for Windows. Using zigmod's default capabilities it wasn't possible, so I spoke with nektro who suggested this new system.

from capy.

GoWind avatar GoWind commented on May 23, 2024

I need not do this on Linux:

const pathToZgt = ".zigmod/deps/git/github.com/zenith391/zgt/";
try deps.imports.zgt.install(exe, pathToZgt);

Zigmod is emitting the right compiler flags for gtk and C without having to call the install method.
I guess the zgt.install workaround is more for Windows than for Linux at the moment !

Also, the imports struct in deps.zig is empty by default with zigmod

   pub const _s2cq94y1b4ve = Package{
        .directory = dirs._s2cq94y1b4ve,
    };
    pub const _deeztnhr07fk = Package{
        .directory = dirs._deeztnhr07fk,
        .pkg = Pkg{ .name = "zgt", .source = .{ .path = dirs._deeztnhr07fk ++ "/build_zgt.zig" }, .dependencies = null },
        .system_libs = &.{ "gtk+-3.0", "c" },
    };
    pub const _l21900j9ct9e = Package{
        .directory = dirs._l21900j9ct9e,        .pkg = Pkg{ .name = "ziglyph", .source = .{ .path = dirs._l21900j9ct9e ++ "/src/ziglyph.zig" }, .dependencies = null },
    };
    pub const _5r4tmy3ww54d = Package{
        .directory = dirs._5r4tmy3ww54d,
        .pkg = Pkg{ .name = "zigstr", .source = .{ .path = dirs._5r4tmy3ww54d ++ "/src/Zigstr.zig" }, .dependencies = &.{ _l21900j9ct9e.pkg.? } },
    };
    pub const _root = Package{
        .directory = dirs._root,
    };
};

pub const packages = &[_]Package{
    package_data._deeztnhr07fk,    package_data._5r4tmy3ww54d,
};

pub const pkgs = struct {
    pub const zgt = package_data._deeztnhr07fk;
    pub const zigstr = package_data._5r4tmy3ww54d;
};

pub const imports = struct {
};

from capy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.