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

How to remove unittest when linking #17409

Open
dlangBugzillaToGithub opened this issue Jul 16, 2020 · 1 comment
Open

How to remove unittest when linking #17409

dlangBugzillaToGithub opened this issue Jul 16, 2020 · 1 comment

Comments

@dlangBugzillaToGithub
Copy link

cbleser reported this on 2020-07-16T08:24:35Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=21046

CC List

  • Rainer Schuetze

Description

I have not been able to finf a way to link program without unittest if I link with library archives which has been compile with -unittest.

The if just one of the .a/.o has been compile with -unittest the main program is linked with unittest.

This means that you have to recompile all the libraries or else the main just run the unittest.

This has changed after the dmd compiler --DRT-testmode=run-main was introduced.

I don't know if the dmd/linker has a switch which can force unittest out of the linking process?

Best
Carsten
@dlangBugzillaToGithub
Copy link
Author

r.sagitario commented on 2020-07-18T06:43:50Z

I guess you didn't mean to set component "visuald".

I don't think you can easily strip the unittests, because they are referenced by the ModuleInfo that is generated for each module. A workaround might be to embed the testmode setting into the executable:

extern(C) __gshared string[] rt_options = [ "testmode=run-main" ];

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

No branches or pull requests

2 participants