Sharpmake icon indicating copy to clipboard operation
Sharpmake copied to clipboard

Linux & Windows Generation

Open d11ahirst opened this issue 4 years ago • 12 comments

Hi,

I am trying to generate both a windows and linux project using 0.16 however I am coming across this issue?

Contains distinct configurations with the same name, please add something to distinguish them:

- Debug|x64 => 'TestAppSolution:vs2017_Lib_linux_Debug'
- Debug|x64 => 'TestAppSolution:vs2017_Lib_win64_Debug'

Because they both share x64 as platform Its having a hard time generating.

Any ideas on how to fix this?

Thanks

d11ahirst avatar Aug 24 '21 13:08 d11ahirst

Heya! Yes, you need to change the configuration name in your configure all and add something to distinguish them, as the message says :)

Something like:

[Configure]
public virtual void ConfigureAll(Configuration conf, Target target)
{
    // ...
    conf.Name = "[target.Optimization]_[target.Platform]";
}

belkiss avatar Aug 24 '21 13:08 belkiss

Thanks for the quick response Works a treat.

d11ahirst avatar Aug 24 '21 14:08 d11ahirst

Actually the problem is now it thinks the win64 build is a linux build so wants to use the connection manager.

d11ahirst avatar Aug 24 '21 14:08 d11ahirst

You mean when debugging? Could you post a screenshot of the property grid and the error you're getting?

belkiss avatar Aug 24 '21 14:08 belkiss

image

When I have x64 windows selected it wants to use Linux connection Manager

cut

d11ahirst avatar Aug 24 '21 14:08 d11ahirst

Hum be careful about the Platform dropdown, select the Active configuration instead of linux: image

belkiss avatar Aug 24 '21 15:08 belkiss

Also I meant to ask for a screenshot of the project property pane, not the solution configuration

belkiss avatar Aug 24 '21 15:08 belkiss

Sorry about that

You can see I have active selected but its display the connection manager at the top

image

d11ahirst avatar Aug 24 '21 15:08 d11ahirst

Interesting, looks like the application type is set to linux for the whole vcxproj and not only for the linux configuration. Could you try separating the vcxproj to see if it works better?

conf.ProjectFileName = "[project.Name]_[target.Platform]";

belkiss avatar Aug 24 '21 15:08 belkiss

It looks like it does work a little better, I end up with multiple projs and have to switch startup apps as well as platform

image

d11ahirst avatar Aug 25 '21 07:08 d11ahirst

It does seem like there is a problem of linux and windows coexisting, perhaps its due to sharing x64?

d11ahirst avatar Aug 25 '21 08:08 d11ahirst

Either that or sharpmake needs to protect some sections in the vcxproj with tests of the platform, like the application type.

belkiss avatar Aug 25 '21 08:08 belkiss