Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for NimX is unclear. #499

Open
ShockedCoder opened this issue Aug 9, 2022 · 3 comments
Open

Documentation for NimX is unclear. #499

ShockedCoder opened this issue Aug 9, 2022 · 3 comments

Comments

@ShockedCoder
Copy link

I cannot seem to find a solution to changing some of the attributes of "Builder".

I'm trying to do it like this after looking through the code:

import nimx/naketools
import strformat

const
    appName           = "CollectiveGallery"
    appVersion        = "1.0"
    javaPackageId     = &"eu.example.{appName}"
    activityClassName = &"{javaPackageId}.MainActivity"
    mainFile          = "src/CollectiveGallery"
    bin               = mainFile


var cgBuild = newBuilder() # cg = CollectiveGallery

cgBuild.appName           = appName
cgBuild.appVersion        = appVersion
cgBuild.javaPackageId     = javaPackageId
cgBuild.activityClassName = activityClassName
cgBuild.mainFile          = mainFile

beforeBuild(cgBuild)

But, as expected, this doesn't work and I'm met with a SIGSEGV error.

There also doesn't seem to be a way to change what name the binary ends up as.

@ShockedCoder ShockedCoder changed the title Instructions unclear Documentation for NimX is unclear or incomplete. Aug 9, 2022
@ShockedCoder ShockedCoder changed the title Documentation for NimX is unclear or incomplete. Documentation for NimX is unclear. Aug 9, 2022
@yglukhov
Copy link
Owner

Here's how it should look like:

import nimx/naketools

# Your constants here ...

beforeBuild = proc(b: Builder) =
  b.mainFile = mainFile
  b.appName = appName
  # ... etc...

There also doesn't seem to be a way to change what name the binary ends up as.

True, there's no way to adjust final executable name. It is either appName.* or main.* depending on target platform. What is the reason you want the binary name to be different?

@ShockedCoder
Copy link
Author

What is the reason you want the binary name to be different?

A bit late because i forgor💀, but because why not?

There's no reason not to be able to have the name of the resulting executable not be customizable.

@nixfreak
Copy link

You don't have to use naketools then. Just use nim c -r --threads:on <file>.nim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants