1. 1

    xmake looks like a really interesting project that has some very attractive features? Are there any prominent projects using it currently?

    1. 1

      @ruki: I’ve noticed that with game engines that people make at home and try to promote. Usually if you write an engine, a library, etc. it’s nice to actually have a full use case / demo / application done with it. For example, Unreal Engine 4 has tons of tech demos, short films, etc. that are made with it. A game engine lives and dies by the projects it’s been used to create. In my opinion, the same applies for code libraries.

      1. 1

        Ok, Thank you for your advice.

      1. 1

        Is there a good guide out there somewhere for using xmake as a replacement for make for projects that are not necessarily C, C++, and so on? I use make to do some automation so that I don’t have to remember complex docker commands and to automate some diagrams and financial reports. I’d love to use something that is not make to do this but make is just always… there.

        1. 1

          You can see the partial english document and api manual in http://xmake.io/#/home

          1. 1

            I looked through the documentation and couldn’t find what I was looking for, thus inspiring my post. I want to turn something like this into xmake:

            all: report.html
            
            %.html: %.md
                md2html $< $@
            
            %.md: %.ledger
                echo "# Report \n\n \`\`\`" > $@
                $(LEDGER_BIN) -f $< bal >> $@
                echo "\`\`\`" >> $@
            
            1. 1

              In current version you need to customize the after_build to implement it:

              target("test")
                  -- or after_package/after_install
                  after_build(function (target)
                      for _, sourcefile in ipairs(os.files("$(projectdir)/src/*.ledger")) do
                            local mdfile = sourcefile .. ".md"
                            io.writefile(mdfile, "xxxxxx")
                            os.exec("md2html %s %s", mdfile, mdfile .. ".html")
                      end
                  end)
              

              If you want to extend add_files to implement more flexible custom build rules, I’m currently developing and will support it. in the next version You can see https://github.com/tboox/xmake/issues/149

              1. 1

                You can update the newest version in master branch and use the following code to custom building rule:

                rule("markdown")
                    set_extensions(".md", ".markdown")
                    on_build(function (target, sourcefile)
                          os.exec("md2html %s %s", sourcefile, sourcefile .. ".html")
                    end)
                
                rule("ledger")
                    add_imports("core.project.rule")
                    on_build(function (target, sourcefile)
                        -- ...
                        rule.build("markdown", target, sourcefile)
                    end)
                
                target("test")
                    add_rules("markdown", "ledger")
                    add_files("./src/*. md")
                    add_files("./src/*. ledger")
                
          1. 1

            Cool to see you continue working on this @ruki! Any interesting things you ran in to when doing the IDEA integration?

            1. 1

              yeah, ui customization is very flexible in the IDEA.

            1. 7

              How is short changelog for point release relevant for this site? There is no interesting technical information in the linked post.

              1. 1

                Change to the license is kinda useful to know, although it would be nice if more information was posted @ruki.

                1. 1

                  Ok, thanks!

                  1. 1

                    This looks rather interesting. Anyone using xmake? I was browsing the manual, and a substantial portion seems to be in Chinese (and the authors seem to be working on that). Having a Lua-based alternative to CMake would be pretty nice.

                    1. 2

                      I am sorry for the incomplete English document, I am trying to translate it.

                      1. 2

                        Premake is another one.

                        I’ve yet to try either, but the idea of “CMake without the arcane DSL” is certainly appealing.

                        1. 2

                          Premake is used a lot for games and middleware. It’s pretty good, I don’t like everything about it but it’s certainly better than cmake.

                          There’s also tundra but I don’t think that has as much traction.

                          If you have very simple build requirements (and I would argue that you should because build systems are the devil) then it’s quite easy to write a scriptable Makefile generator. See one and two. Vcxproj generation is trickier but still easy enough to figure out just by looking at what VS/premake generate for simple projects, or you can just use Cygwin and make but then getting files to rebuild when their headers do is annoying.

                          1. 2

                            You can use xmake to build project in cmd directly and it can also generate vcproj: $ xmake project -k vs2017

                      1. 1

                        @ruki, I’m very impressed at your steady release of new cool tools! Thank you for sharing them with us!

                        1. 2

                          Thanks for your support! :)

                        1. 2

                          The project focuses on making C development easier and provides many modules (.e.g stream, asio, regex, container, algorithm …), so that any developer can quickly pick it up and enjoy the productivity boost when developing in C language.

                          1. 5

                            Big of tag gore here I think, probably just ‘programming’ is sufficient.

                            1. 1

                              Big of tag gore here I think, probably just ‘programming’ is sufficient.

                              Ok, thanks!

                              1. 1

                                There’s a lot of diverse opinions in this community. Don’t change so quickly if one counterpoint shows up. Some would be fine with your tags since they’re filters for stuff people don’t want to see on their version of the front page (I think…). Yours are accurate esp adding Lua so non-Lua users might avoid it.

                                Only one Im not sure about is release. It’s ambiguous tag given any published piece of software or tech is a release of sorts. I don’t use it unless it’s established software upgrading to new version or a Show Lobsters for software. I dont know what the community’s consensus is on it. So, I think your tags are fine.

                            1. 1

                              A make-like build utility based on Lua.

                              github: https://github.com/waruqi/xmake

                              1. 3

                                What is it? Pet peeve: OSS projects that don’t clearly state what the heck the thing is.

                                1. 1

                                  On many pages like this, you can get to the general description through a link on the page. It’s most convenient when it says About, Overview, or Features. However, many of them just say the name of the project in isolation or next to other ones. Load up the Lobster’s submission, look to the right side of page, notice the project list with item called tbox, and click that to find what you seek.

                                  1. 1

                                    A glib-like multi-platform c library. You can see the github link: https://github.com/waruqi/tbox

                                    : )

                                  1. 1

                                    Ruki, could you give a pseudocode version of the algorithm here, for a polygon defined by a line strip. You know, x1 y1 x 2 y2 etc.

                                    1. 3

                                      I am sorry, I can hardly describe clearly by the pseudo-code algorithm.

                                      You can refer to the comments in the source code if want to know more about this algorithm. :)

                                      https://github.com/waruqi/gbox/blob/master/src/gbox/utils/impl/tessellator/monotone.c

                                      1. 1

                                        wondering how xmake handle third-party libraries and internal module for c project. I think the combination of xmake and clib is a double win :)

                                        1. 3

                                          xmake can integrate local packages automatically now.

                                          .e.g

                                          add_packagedirs("pkg") 
                                          target("demo")
                                              add_package("sqlite3", "openssl")
                                          

                                          You can refer to https://github.com/waruqi/tbox/blob/master/src/tbox/xmake.lua and the packges https://github.com/waruqi/tbox/tree/master/pkg

                                          xmake will suport manage package and dependencies in the next version. and it will be able to patch and compile third-party libraries for the cross-platform automatically. : )

                                        1. 2

                                          The Most Important Question™: how big is the resulting binary executable?

                                          1. 3

                                            Less than 500KB for the smallest configuration (xmake config –smallest=y)

                                          1. 3

                                            Maybe I misread some part of the documentation, but I don’t quite understand how this is “for Lua”. The only part I see regarding Lua is that the xmake file itself looks to be written in Lua, but is used to build C, C++, or Assembly. Can anyone confirm or correct this assumption?

                                            1. 4

                                              Oh, I’m sorry, my english is too poor!

                                              My mean is “base on Lua”. It’s my mistake!

                                              : )