Skip to content

Improve Nim language support as target #6488

Open
@griffith1deady

Description

@griffith1deady

Xmake Version

xmake v2.9.9+dev.a6af349ad, A cross-platform build utility based on Lua

Operating System Version and Architecture

Windows 11 IoT 24H2

Describe Bug

The essence of the problem: if you use a single-file project, everything is fine. If you make a project with any structure that includes for example:

main.nim:

import something
echo "Hello, world!

something.nim:

echo "Hello from something!"

At the first compilation everything will be fine. but if you only make changes to the files on which add_files("src/main.nim") depends, the target will not rebuilded. Also, add_files("src/*.nim") does not solve the problem, because each file will be built as a separate application, which is unacceptable.
I love xmake and use it extensively with nim, but now I have to use task which will run os.run("nim c ...") because there is no support for anything more complex than a single-file project, but I love the work done on xrepo. also, passing arguments to the native linker or native compiler doesn't work properly, causing the nim compiler to think we're trying to pass arguments to a running application and display an error.
also, importc paired with add_deps/add_packages won't properly link static/shared dependencies for some strange reason.

Expected Behavior

  • Correctly rebuild target when project files changed, not only main target file;
  • Correctly link static/shared dependencies (also can come from xrepo);
  • Correctly pass linker/compiler argument's as passL:"..." and passC:"..." to nim compiler

Project Configuration

target("sellage")
set_kind("binary")
add_files("src/main.nim")

see $describe bug for project example

Additional Information and Error Logs

None. I don't remember all aspect's that not work with static/shared dependencies, but i can to deal with it later if the problem is not on the surface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions