Git Product home page Git Product logo

ubisoft / sharpmake Goto Github PK

View Code? Open in Web Editor NEW
888.0 888.0 160.0 16.08 MB

Sharpmake is an open-source C#-based solution for generating project definition files, such as Visual Studio projects and solutions, GNU makefiles, Xcode projects, etc.

License: Apache License 2.0

C# 98.51% Batchfile 0.21% Python 0.47% C++ 0.15% C 0.03% PowerShell 0.63%
bff csharp csproj fastbuild sln ubisoft vcxproj visual-studio

sharpmake's People

Contributors

aganea avatar anthony-brien avatar baudronp avatar bchampoux avatar belkiss avatar brousseau-ubi avatar cmello avatar dependabot[bot] avatar fabianrmd avatar fbole-feysot avatar fmizac avatar forgeron avatar guiguibubu avatar idevubi avatar jairbubbles avatar jspelletier avatar jtanakau avatar kant avatar kudaba avatar laurentm-ubi avatar lmveilleux-ubi avatar louis-z avatar mundak avatar nidoizo avatar shawnczek avatar sylvain-audi avatar sylvainfortin avatar trithek avatar vitaliitrubchaninovubisoft avatar yhuang-i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sharpmake's Issues

Latest Visual Studio no longer using csproj.user for startup parameters

I noticed this with VS version 16.10.1, I'm not sure when this change was introduced.

When I generate a debug solution via /generateDebugSolution, the startup parameters are stored in the csproj.user file.
Visual Studio no longer shows that on the Project/Debug settings property page - that page is empty. However when you set it up it is saved to a launchSettings.json file, not the csproj.user file.

And what is incredibly confusing is even though the startup parameters from the csproj.user file are not shown anywhere in the VS property pages, when you try to run the app, they are combined with the parameters from the launchSettings.json.

I found the bug report on the VS community page: https://developercommunity.visualstudio.com/t/conflict-with-user-and-launchsettingsjson/1329683

I'm not sure what is the best way forward. Hopefully by just reporting it here I'll save some frustration for other people.
I think the two options are

  1. wait and see if they fix it in VS
  2. change Sharpmake to support launchSettings.json. In this case I'd think we still want to keep supporting csproj.user for users of older VS versions.
  3. do nothing. Running the generated project still works, as the csproj.user settings are used, but if someone tries to change the parameters in VS they will run into this problem.

ResourcesPath and ContentPath have invalid values.

The values of ResourcesPath and ContentPath are combined with RootPath in InitCSharpSpecifics (https://github.com/ubisoftinc/Sharpmake/blob/dev/Sharpmake/Project.cs#L2126), but because this is called from the constructor the value of RootPath will always be an empty string.
This causes CSharpProject types to fill ResolvedResourcesFullFileNames and ResolvedContentFullFileNames with all files found in "/Resources/" and "/Content/", which will be interpreted to for example "C:/Resources" if the working directory is on the C: drive. This adds all the files found in those folders to the C# project, even though they are not related to the project at all.

A simple fix for the issue would be to wait with combining RootPath and ResourcesPath/ContentPath until the ResolveSourceFiles method of Project.cs.

Options.Vc.General.PlatformToolset is ignored by FastBuild generator

The FastBuild generator only uses the DevEnv set in the target, and completely ignores the value of Options.Vc.General.PlatformToolset in the options of that configuration, that might have been set to something different than "Default".
As a first step, the code should at least report that this is unsupported, but ideally the platform toolset should be handled by the FastBuild generator.

TextTemplatingFilePreprocessor

Hi,

I have a number of text templates that are using the TextTemplatingFilePreprocessor value in the generation tags. I can't seem to find a way to added them to a project. The code seems to use AdditionalNone to allow for this, but it doesn't work. Anyone have any idea of how to set this. Or is there a way to customize the tags it contains?

Thank you

/generateDebugSolution does not work

Following along with the example here: https://github.com/ubisoftinc/Sharpmake/blob/master/docs/OVERVIEW.md#create-a-debugging-environment

I've added the /generateDebugSolution option to my build:

..\bin\Sharpmake.Application.exe /sources(@"main.sharpmake.cs") /verbose /generateDebugSolution

The result is as follows:

E:\dev\C++\fbxdebugger\build>..\bin\Sharpmake.Application.exe /sources(@"main.sharpmake.cs") /verbose /generateDebugSolution
[00:00] sharpmake
[00:00]   arguments : /sources(@"main.sharpmake.cs") /verbose /generateDebugSolution
[00:00]   directory : E:\dev\C++\fbxdebugger\build
[00:00]
[00:00] input sources:
[00:00]   E:\dev\C++\fbxdebugger\build\main.sharpmake.cs
[00:00]   building projects and solutions configurations using 8 tasks...
[00:00]     build done in 0.0 sec

Error:
The type "Sharpmake.DebugSolution" does not declare a constructor, please add one to allow Sharpmake to detect source file from construction callstack.
[00:00]         While running E:\dev\C++\fbxdebugger\bin\Sharpmake.Application.exe
        @9/21/2018 11:52:39 PM: Exception message (level 0):
        Unhandled exception in thread pool
        Inner exception message (level 1):
        Cannot create instances of type: DebugSolution, caught exception message Exception has been thrown by the target of an invocation.. Make sure default ctor is public
        Inner exception message (level 2):
        Exception has been thrown by the target of an invocation.
        Inner exception message (level 3):
        The type "Sharpmake.DebugSolution" does not declare a constructor, please add one to allow Sharpmake to detect source file from construction callstack.

        Stack trace:
        Inner exception stack trace (level 3):
   at Sharpmake.Util.GetStackSourceFileTopMostTypeOf(Type type, String& sourceFile)
   at Sharpmake.Solution.Initialize(Type targetType)
   at Sharpmake.DebugSolution..ctor()
        Inner exception stack trace (level 2):
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Sharpmake.Solution.CreateProject(Type solutionType, List`1 fragmentMasks)
        Inner exception stack trace (level 1):
   at Sharpmake.Solution.CreateProject(Type solutionType, List`1 fragmentMasks)
   at Sharpmake.Builder.LoadSolutionType(Type type)
   at Sharpmake.Builder.BuildProjectAndSolutionTask(Object parameter)
   at Sharpmake.ThreadPool.ThreadWork(Object obj)
        Root stack trace (level 0):
   at Sharpmake.ThreadPool.Wait()
   at Sharpmake.Builder.BuildProjectAndSolution()
   at Sharpmake.Application.Program.CreateBuilder(BaseBuildContext context, Argument parameters, Boolean allowCleanBlobs, Boolean generateDebugSolution)
   at Sharpmake.Application.Program.GenerateAll(BaseBuildContext buildContext, Argument parameters)
   at Sharpmake.Application.Program.Main()

my sharpmake source file is as follows:

using System.IO; // for Path.Combine
using Sharpmake; // contains the entire Sharpmake object library.

// Represents the project that will be generated by Sharpmake and that contains
// the sample C++ code.
[Generate]
class BasicsProject : Project
{
    private string ImGuiRootPath;
    public BasicsProject()
    {
        // The name of the project in Visual Studio. The default is the name of
        // the class, but you usually want to override that.
        Name = "Basics";

        // The directory that contains the source code we want to build is the
        // same as this one. This string essentially means "the directory of
        // the script you're reading right now."
        SourceRootPath = @"[project.SharpmakeCsPath]\..\src";
        ImGuiRootPath = @"[project.SourceRootPath}\..extern\imgui";

        SourceFiles.Add(@"[project.ImGuiRootPath]\imgui.cpp");
        SourceFiles.Add(@"[project.ImGuiRootPath]\imgui_draw.cpp");
        SourceFiles.Add(@"[project.ImGuiRootPath]\imgui_widgets.cpp");

        // Specify the targets for which we want to generate a configuration
        // for. Instead of creating multiple targets manually here, we can
        // use the binary OR operator to define multiple targets at once.
        // Sharpmake will generate all combinations possible and generate a
        // target for it.
        //
        // The code below is the same as creating 4 separate targets having
        // those flag combinations:
        //    * Platform.win32, DevEnv.vs2015, Optimization.Debug
        //    * Platform.win32, DevEnv.vs2015, Optimization.Release
        //    * Platform.win64, DevEnv.vs2015, Optimization.Debug
        //    * Platform.win64, DevEnv.vs2015, Optimization.Release
        AddTargets(new Target(
            // we want a target that builds for both 32 and 64-bit Windows.
            Platform.win32 | Platform.win64,

            // we only care about Visual Studio 2017. (Edit as needed.)
            DevEnv.vs2017,

            // of course, we want a debug and a release configuration.
            Optimization.Debug | Optimization.Release));
    }

    // Sets the properties of each configuration (conf) according to the target.
    //
    // This method is called once for every target specified by AddTargets. Since
    // we only want vs2015 targets and we want 32- and 64-bit targets, each having
    // a debug and a release version, we have 1 x 2 x 2 targets to configure, so it
    // will be called 4 times.
    //
    // If we had instead specified vs2012 | vs2015 | vs2017 it would have been
    // called 12 times. (3 x 2 x 2)
    [Configure]
    public void ConfigureAll(Project.Configuration conf, Target target)
    {
        // Specify where the generated project will be. Here we generate the
        // vcxproj in a /generated directory.
        conf.ProjectPath = Path.Combine("[project.SharpmakeCsPath]", "generated");
        conf.IncludePaths.Add(@"[project.SourceRootPath]\..\extern\imgui");
    }    
}

// Represents the solution that will be generated and that will contain the
// project with the sample code.
[Generate]
class BasicsSolution : Solution
{
    public BasicsSolution()
    {
        // The name of the solution.
        Name = "Basics";

        // As with the project, define which target this solution builds for.
        // It's usually the same thing.
        AddTargets(new Target(
            Platform.win32 | Platform.win64,
            DevEnv.vs2017,
            Optimization.Debug | Optimization.Release));
    }

    // Configure for all 4 generated targets. Note that the type of the
    // configuration object is of type Solution.Configuration this time.
    // (Instead of Project.Configuration.)
    [Configure]
    public void ConfigureAll(Solution.Configuration conf, Target target)
    {
        // Puts the generated solution in the /generated folder too.
        conf.SolutionPath = @"[solution.SharpmakeCsPath]\generated";

        // Adds the project described by BasicsProject into the solution.
        // Note that this is done in the configuration, so you can generate
        // solutions that contain different projects based on their target.
        //
        // You could, for example, exclude a project that only supports 64-bit
        // from the 32-bit targets.
        conf.AddProject<BasicsProject>(target);
    }

    [Main]
    public static void SharpmakeMain(Arguments sharpmakeArgs)
    {
        // Tells Sharpmake to generate the solution described by BasicsSolution.
        sharpmakeArgs.Generate<BasicsSolution>();
    }
}

Better sharpmake scripts and intellisense support

What's the recommendation for working with sharpmake scripts? I understand they're written in C# so I would expect to have some intellisense, because C# without intellisense just sucks.

Also, take a look at https://github.com/filipw/dotnet-script for roslyn-based scripting solution (.csx) which might be a good replacement for what you have now and there's support for it in vscode

There would be no need for a namespaces and script files would be significantly easier to read and write. Also, take inspiration from here: https://github.com/cake-build/example/blob/master/build.cake

https://daveaglick.com/posts/roslyn-based-dsls-vs-standard-csharp-scripts

Either use Dotnet.Script.Core nuget or write a custom solution

https://github.com/dotnet/roslyn/wiki/Scripting-API-Samples#addref
https://github.com/filipw/dotnet-script/blob/640f365d78c2a725b0a2b902c2a7ecc9357255ac/src/Dotnet.Script.Core/ScriptCompiler.cs#L30

or don't use C# for scripting at all (look at http://www.moonsharp.org/, https://github.com/frabert/NetLua)

scripts in CMake and premake are much more readable IMO

GoogleTest + Sharpmake

Visual Studio propose an integration of the GoogleTest framework through "Google Test Adapter" extension.
Which allow us to use "Test Explorer Windows".
That give us a new project property group:
image
I tried to add a new dll project with all dependencies of gtest (googletest).
But the gtest project have packages.config file with references (from visual studio gtest template):
image

I wasn't able to find a hook in Sharpmake API to deal with those elements.

Do you have any advice how I could add GTest project with Sharpmake.

Incorrect DLL in Basic Tuto Wiki

It is write int the current Basic Tuto in the WIKI to find SimpleNuget.dll wich does not exit after you generate Sharpmake App. The other problem is that Sharpmake App does not compile without adding the "Microsoft.VisualStudio.Setup.Configuration.Interop" package. With this package it works and you need to use "Microsoft.VisualStudio.Setup.Configuration.Interop.dll" and not "SimpleNuget.dll", wich doesn't exist, to use SharpMake.Application.exe to generate our HelloWorldProject.

Is it possible to correct the Wiki ?

Here is my proposal :

"
Open Sharpmake.sln in Visual Studio and compile Sharpmake.Application (if it doesn't work, use the NuGet Package Manager to install Microsoft.VisualStudio.Setup.Configuration.Interop and retry). Then,
in the output folder of the application, take the following binaries and copy
them in an empty folder:

  • Sharpmake.Application.exe
  • Sharpmake.dll
  • Sharpmake.Generator.dll
  • Sharpmake.CommonPlatforms.dll
  • SimpleNuGet.dll ( or Microsoft.VisualStudio.Setup.Configuration.Interop.dll)
    "

and

"
We are done with main.sharpmake.cs. Save it.

Your directory should look like this:

  • main.cpp
  • main.sharpmake.cs
  • Sharpmake.Application.exe
  • Sharpmake.CommonPlatforms.dll
  • Sharpmake.dll
  • Sharpmake.Generators.dll
  • SimpleNuGet.dll ( or Microsoft.VisualStudio.Setup.Configuration.Interop.dll)
    "

Port to .NET Core

I ran dotnet-apiport against the project and it seems like it's pretty compatible ๐Ÿ˜„
https://1drv.ms/x/s!ArqMTZb-afYkgQh9voOZzGCd7NKh

https://docs.microsoft.com/en-us/dotnet/core/porting/

Porting to .NET Core would make Sharpmake cross-platform just like CMake is and possibly increase performance too.

The first step would be to convert project files to the new format.

If I wanted to submit a PR, I should work on dev branch is that right?

EDIT: I already ported the project to the newer csproj format which greatly simplifies things but then I've noticed it's using itself now to generate project (74c8af9 )

which complicates things a bit... so either:

  • revert this commit and use new csproj format
  • write generator for new csproj format (does it make sense anyway?)

then another cool thing would be to make use of dotnet tool to install sharpmake easily without building it yourself.

Platform Modules

Hi,

I am just wondering the best route to take getting hold of the XboxOne/Series X modules?

I tried contacting on the Dev forum without success.

Could anyone help?

Much Appreciated.

Adding a CustomBuildStep

I'm trying to add a custom build steps to compile my shader files, but the custom build properties are empty.

I derive from Project.Configuration.CustomFileBuildStep and fill in the properties of the class:

public class ShaderCompileBuildStep : Project.Configuration.CustomFileBuildStep
 {
     ShaderCompileBuildStep(string sourceFileName)
      {
          // fill in KeyInput, Executable, etc.
      }

I add the extension to the project's supported extensions:

SourceFilesExtensions.Add(".fx");

I then override Project.ExcludeOutputFiles():

protected override void ExcludeOutputFiles()
{
    base.ExcludeOutputFiles();
    GenerateShaderCustomBuildSteps();
}

In GenerateShaderCustomBuildSteps(), I add the custom build steps to the project configuration:

 private void GenerateShaderCustomBuildSteps()
 {
     foreach (var f in ResolvedSourceFiles.Where(f => System.IO.Path.GetExtension(f).ToLower() == ".fx"))
    {
        foreach (Project.Configuration conf in Configurations)
        {
            conf.CustomFileBuildSteps.Add(new ShaderCompileBuildStep(f));
         }
    }
}

In Visual Studio, my .fx files have the proper "Item Type" of "Custom Build Tool", but all of the properties in "Custom Build Tool" are empty.

What am I doing wrong?

Dynamic project creation support

This is more of a feature request than an issue.

I have various version of a project, each in a diffrent folder:

  • Root
    • MyProject_v1
    • MyProject_v2
    • MyProject_v3

I wanted to create a generic 'class myProject' and in 'Solution.ConfigureAll()' find all directories to dynamically add them as different projects :

public class myProject : project
{
	myProject(string dirName)
	{
		Name = dirName;
		SourceRootPath = @"[project.SharpmakeCsPath]\" + dirName;
	}
}

public class mySolution
{
	public void ConfigureAll(...)
	{
		list dirList = FindDirectories();
		for each dirName in dirList
			conf.AddProject<myProject>(target);
	}
}

I don't think this is possible, since there's no way to pass constructor parameters and would probably cause issue with system unable to differentiate between various 'myProject' class instances. Templating 'myProject' doesn't seems like it would help either, with 'generic' limitations.

For the moment, I have to manually declare a child class of 'myProject' per version and specify the path with a string constant. Is there a way to achieve this that I'm missing? If not, it might be nice to have an extra parameter that help uniquely identify a 'Project' and which we could also read in the constructor to change configuration. Something like :

public class mySolution
{
   public void ConfigureAll(...)
   {
   	for each dirName in dirList
   		conf.AddProject<myProject>(target, dirName); // dirName added as constructor parameter
   }
}

public class otherProject : project
{
   public void ConfigureAll(...)
   {
   	conf.AddPublicDependency<myProject>(target, "MyProject_v1");
   }
}

Basic tutorial example code doesn't work unless classes are marked as public

I attempted to follow the Basic Tutorial by simply copying the code in main.sharpmake.cs and found that I could not successfully run sharpmake without marking the derived Project and Solution classes as public. Failing to do so produces the following error:

Error:
Sharpmake has nothing to generate!
Make sure to have a static entry point method flagged with [Sharpmake.Main] attribute, and add 'arguments.Generate<[your_class]>();' in it.

I suggest changing the example code and possibly leaving a note about this requirement for clarity. As a C++ developer I was not aware of the difference between public and internal c# classes until I looked at the "Hello World" sample!

Exception when processing command line

I have been trying to add a command line option to my script parsing using the example set out in the documentation, but when I call ExecuteOnObject the script throws an exception. The details are below:

Object reference not set to an instance of an object.
        While running c:\dev\kestrel\demo\tools\sharpmake\0.8.0\bin\release\Sharpmake.Application.exe
        @15/05/2019 10:17:15: Exception message (level 0):
        Unhandled exception in thread pool
        Inner exception message (level 1):
        Cannot create instances of type: DemoProject, make sure it's public
        Inner exception message (level 2):
        Exception has been thrown by the target of an invocation.
        Inner exception message (level 3):
        Object reference not set to an instance of an object.

        Stack trace:
        Inner exception stack trace (level 3):
   at Sharpmake.Assembler.Build(IBuilderContext builderContext, String libraryFile, String[] sources) in C:\dev\Sharpmake-master\Sharpmake\Assembler.cs:line 439
   at Sharpmake.Assembler.BuildDelegate[TDelegate](String functionBody, String functionNamespace, String[] usingNamespaces, Assembly[] assemblies) in C:\dev\Sharpmake-master\Sharpmake\Assembler.cs:line 223
   at Sharpmake.CommandLine.Execute(Type type, Object instance, String commandLine, String[] namespaces) in C:\dev\Sharpmake-master\Sharpmake\CommandLine.cs:line 235
   at Sharpmake.CommandLine.ExecuteOnObject(Object obj, String commandLine) in C:\dev\Sharpmake-master\Sharpmake\CommandLine.cs:line 53
   at BaseProject..ctor(String name) in c:\dev\scripts\BaseProject.sharpmake.cs:line 32
   at DemoProject..ctor() in c:\dev\scripts\demo.sharpmake.cs:line 14
        Inner exception stack trace (level 2):
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Sharpmake.Project.CreateProject(Type projectType, List`1 fragmentMasks) in C:\dev\Sharpmake-master\Sharpmake\Project.cs:line 1371
        Inner exception stack trace (level 1):
   at Sharpmake.Project.CreateProject(Type projectType, List`1 fragmentMasks) in C:\dev\Sharpmake-master\Sharpmake\Project.cs:line 1378
   at Sharpmake.Builder.LoadProjectType(Type type) in C:\dev\Sharpmake-master\Sharpmake\Builder.cs:line 470
   at Sharpmake.Builder.BuildProjectAndSolutionTask(Object parameter) in C:\dev\Sharpmake-master\Sharpmake\Builder.cs:line 304
   at Sharpmake.ThreadPool.ThreadWork(Object obj) in C:\dev\Sharpmake-master\Sharpmake\ThreadPool.cs:line 208
        Root stack trace (level 0):
   at Sharpmake.ThreadPool.Wait() in C:\dev\Sharpmake-master\Sharpmake\ThreadPool.cs:line 174
   at Sharpmake.Builder.BuildProjectAndSolution() in C:\dev\Sharpmake-master\Sharpmake\Builder.cs:line 292
   at Sharpmake.Application.Program.CreateBuilder(BaseBuildContext context, Argument parameters, Boolean allowCleanBlobs, Boolean generateDebugSolution) in C:\dev\Sharpmake-master\Sharpmake.Application\Program.cs:line 585
   at Sharpmake.Application.Program.CreateBuilderAndGenerate(BaseBuildContext buildContext, Argument parameters, Boolean generateDebugSolution) in C:\dev\Sharpmake-master\Sharpmake.Application\Program.cs:line 382
   at Sharpmake.Application.Program.Main() in C:\dev\Sharpmake-master\Sharpmake.Application\Program.cs:line 292

The object I pass in isn't null, so I'm not exactly sure what isn't initialised here

Repository being not updated

Hi,

I'm wondering if you're planning to sync this git repo with some more recent version of Sharpmake used internally? It's been more than 10 months now since the initial code drop.

Thanks,
Marcin

QT not recompiling resource upon change

Following the "QTFileCustomBuild" sample. Are changes to blank.png being tracked? If I were to change some pixels and then build (not rebuild), should those changes reflect in the application? If so, which lines specifically set this up in the code?

Thanks

generateDebugSolution folder arrangement

Hi,

I notice there is conf.SolutionFolder to give a solution structure when generating the main projects.

Is there something equivalent for when passing the /GenerateDebugSolution argument and generating that solution?

Thanks

Exclude files on ConfigureAll step

Hello, sorry if this explain somewhere but searched documentation and source code but can't find.

I have a framework with multiple platforms and I wanted to exclude folders/files from the project according to each configuration when ConfigureAll()

So I know we can use SourceFilesExcludeRegex.Add to exclude files/patters from project.

But I'm looking into excluding them in ConfigureAll() step, I found conf.SourceFilesBuildExcludeRegex but this is only for excluding from build. Is it possible?
using Project.SourceFilesExcludeRegex on ConfigureAll() says we can't change it on that step, read only.

Or is there a better way to do this?

AdditionalSourceRootPaths is not supported in default generator

Hello,

I tried to use AdditionalSourceRootPaths to provide additional root folders: my projects usually have this kind of layout:
/
src/
src/main.cpp
src/lib.cpp
include/
include/lib.h
bin/
bin/shaders/triangle.hlsl
third-party/

Currently AdditionalSourceRootPaths is not used (only when using fastbuild and xcode it seems ?) to generate a non-blob project.

Is this something that's planned to be supported or you're looking for a PR to address this ?

Thanks for your time !

bootstrap failed for Microsoft.CodeAnalysis

MSBuild batch path: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsMSBuildCmd.bat"


** Visual Studio 2017 MSBuild Command Prompt
** Copyright (c) 2017 Microsoft Corporation


Compiling Sharpmake.Application/Sharpmake.Application.csproj in "Debug|AnyCPU"...
msbuild -t:build -restore "Sharpmake.Application/Sharpmake.Application.csproj" /nologo /verbosity:m /p:Configuration="Debug" /p:Platform="AnyCPU"
Restore completed in 35.7 ms for D:\Users\sharpmake-dev\Sharpmake.Application\Sharpmake.Application.csproj.
Restore completed in 38.62 ms for D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj.
Restore completed in 38.46 ms for D:\Users\sharpmake-dev\Sharpmake.Platforms\Sharpmake.CommonPlatforms\Sharpmake.Comm
onPlatforms.csproj.
Restore completed in 38.13 ms for D:\Users\sharpmake-dev\Sharpmake.Generators\Sharpmake.Generators.csproj.
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.EnableConcurrentExecutionAna
lyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs
Microsoft.CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Cultur
e=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [D:
\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.ClassIsNotDiagnosticAnalyzer
cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Micro
soft.CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Culture=neu
tral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [D:\User
s\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.DoNotUseCompilationGetSemant
icModelAnalyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers
dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0
.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file speci
fied.. [D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.ConfigureGeneratedCodeAnalys
isAnalyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotne
t\cs\Microsoft.CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, C
ulture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
. [D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.DiagnosticAnalyzerAttributeA
nalyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\c
s\Microsoft.CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Cult
ure=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [
D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.DiagnosticDescriptorCreation
Analyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet
cs\Microsoft.CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Cul
ture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
[D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.FixAnalyzers.FixerWithFixAllAnalyzer canno
t be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Microsoft.C
odeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [D:\Users\shar
pmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.InternalImplementationOnlyAnalyzer cannot
be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Microsoft.Cod
eAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Culture=neutral, Pu
blicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [D:\Users\sharpm
ake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.CompareSymbolsCorrectlyAnaly
zer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Mi
crosoft.CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Culture=
neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [D:\U
sers\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpReportDiagnosti
cAnalyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet
\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.
0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file spec
ified.. [D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnaly
zerFieldsAnalyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzer
s\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Vers
ion=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the f
ile specified.. [D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpRegisterActionA
nalyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\c
s\Microsoft.CodeAnalysis.CSharp.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.
0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specif
ied.. [D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.MetaAnalyzers.CSharpDiagnosticAnaly
zerApiUsageAnalyzer cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyz
ers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Ve
rsion=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the
file specified.. [D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.CSharpImmutableObjectMethodAnalyzer
cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Micro
soft.CodeAnalysis.CSharp.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Cult
ure=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.. [
D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.CSharp.Analyzers.CSharpUpgradeMSBuildWorkspaceAnalyz
er cannot be created from C:\Users\gyyin.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Mic
rosoft.CodeAnalysis.CSharp.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Cu
lture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
[D:\Users\sharpmake-dev\Sharpmake\Sharpmake.csproj]
ERROR: Failed to compile Sharpmake.Application/Sharpmake.Application.csproj in "Debug|AnyCPU".
Bootstrap failed

Embed Interop references support

Hi,

We have made some change to add embedded interop support and a few more things. I forked the release branch and I was curious if I was doing the correct thing. Should I be submitting the pull requests to the Dev branch? What's the best way?

Django

Binaries output

I am addressing this particular "Building Sharpmake" section here - bold part:

Building Sharpmake is quite straightforward. Clone the repo on GitHub, run the "bootstrap" script (".bat" for Windows, ".sh" for Unix platforms), open the solution in Visual Studio and build the solution in Release. The binaries will be found in the Sharpmake.Application/bin/Release. You can run the deploy_binaries.py script to automatically fetch the binaries and copy them in a Binaries folder.

...no, it is not, everything ends up into "tmp" - compiled with "bootstrap.bat" as-is under Windows with all the latest VS (same for 2019/2022).

generateDebugSolution creates invalid /sources command line parameters in the csproj.user file

When running Sharpmake with /generateDebugSolution and passing multiple /source arguments to the original command line, the resulting csproj.user file has invalid syntax in the /source arguments. Eg.

original Sharpmake command line:

/generateDebugSolution /sources(@"d:\folder\file1.sharpmake.cs",@"d:\anotherfolder\anotherfile.sharpmake.cs")

the tag in the generated csproj.user file however looks like this:

/sources(@'d:\folder\file1.sharpmake.cs;d:\anotherfolder\anotherfile.sharpmake.cs')

which is invalid and results in the following exception:

	The given path's format is not supported.

	Stack trace:
	Root stack trace:
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at System.IO.Path.GetFullPath(String path)
   at Sharpmake.Application.Program.Argument.ValidateFiles(String[] files) in d:\github\sharpmake\Sharpmake.Application\CommandLineArguments.cs:line 395
   at Sharpmake.Application.Program.Argument.SetSources(String[] files) in d:\github\sharpmake\Sharpmake.Application\CommandLineArguments.cs:line 77


This patch fixes it, in DebugProjectGenerator.cs

        public static void SetupProjectOptions(this Project.Configuration conf, string startArguments)
        {
            conf.CsprojUserFile = new Project.Configuration.CsprojUserFileSettings();
            conf.CsprojUserFile.StartAction = Project.Configuration.CsprojUserFileSettings.StartActionSetting.Program;

            string quote = "\'"; // Use single quote that is cross platform safe

-            conf.CsprojUserFile.StartArguments = $@"/sources(@{quote}{string.Join(";", MainSources)}{quote}) {startArguments}";
+            conf.CsprojUserFile.StartArguments = $@"/sources(@{quote}{string.Join($"{quote},@{quote}", MainSources)}{quote}) {startArguments}";
            conf.CsprojUserFile.StartProgram = DebugProjectExtension.GetSharpmakeExecutableFullPath();
        }

I tested this with Sharpmake 0.16.0 on Windows 10.

Publish Orbis platform?

CryEngine GitHub repo already has an Orbis CMake Toolchain as well as Durango. https://github.com/bkaradzic/GENie also has some public Orbis platform code.

Why don't you publish Orbis platform code to the repo if you already have Durango which is also non-public? ๐Ÿ˜ƒ

Orbis is not a typical Microsoft platform like Durango so there might be some complications in writing a platform from scratch especially for new users of Sharpmake.

Symbols not loading in debug solution

Hi,

I'm using sharpmake on a small project but I've never gotten the debugging solution to work properly. I can use it to edit my code and it provides me with intellisense but I'm unable to debug. It seems that VS never loads the symbols for the solution.

Any ideas?

Thanks,
Jonathan

What is the DevEnv for Xcode Mac, can only find xcode4ios

Hello,

I was trying to test generating my sharpmake project (already working for Visual Studio) for Mac with Xcode, does it support it? I can only see the DevEnv flag xcode4ios.
Was trying to look through the code and the docs but can't find it, I'm probably missing something obvious so sorry for the question and thanks for the help in advance.

Linux & Windows Generation

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

IncludePaths do not support $() Variables

When adding IncludePaths, its not possible to use Msbuild/Visual Studio predefined macros, like $(ProjectDir), $(SolutionDir) etc. like this: conf.IncludePaths.Add("$(ProjectDir)../A");

This makes it extremely hard to add cross project include paths, like referencing includes defined in a library project inside an application.

Is this intended, and what is the solution? It seems that Sharpmake always resolves all paths to some relative representation, which is undesirable (in my opinion) for include paths.

Issues building for Android platform.

I'm trying to build a simple basic hello world c++ project using Sharpmake on Android platform, I get the the exception "System.Exception: cannot find fragment value of type Sharpmake.Android+AndroidBuildTargets in object Sharpmake.Target".
I'm sorry if this is a simple issue, but i can't get through it. :'(
Also, I would like to know are there any working examples using sharpmake on Android platform, I don't see any sample for Android. thanks

Extended support for build configuration

I have been porting my home engine from using Premake to Sharpmake, enjoying a cleaner project definition approach. Despite going through Sharpmake source code there's a feature I have been unable to find.

I would like to build 2 differents PC targets, one linked against DirectX11 and one against DirectX12. On Premake, I could specify different 'Platforms' name that are all using x64. When compiling I can select
"[Solution Configuration]=>Release" and "[Solution Platform]=>PC64DX12" in the menubar and the code will compile with my Directx12 assigned 'defines' and 'libraries' using the x64 toolchain.

Under the hood, 'Configuration Manager' of my Premake project shows :

Project: libCore
Configuration: Release PC64Dx12
Platform : x64

And vcxproj shows:

<ProjectConfiguration Include="Release PC64DX11|x64">
      <Configuration>Release PC64DX11</Configuration>
      <Platform>x64</Platform>
</ProjectConfiguration>

Is there anything thing I am missing or any chance something like this could be added? I am not sure what would be the prefered way, but maybe we could name a 'target' when adding it, which would add the name to the build 'Platform' and the user could add multiple 'Target' for each variation.

AddTargets(new Target(	"DirectX11",
			Platform.win32|Platform.win64,
			DevEnv.vs2015,
			Optimization.Debug | Optimization.Release | Optimization.Retail,
			OutputType.Lib));
AddTargets(new Target(	"DirectX12"
			Platform.win32|Platform.win64,
			DevEnv.vs2015,
			Optimization.Debug | Optimization.Release | Optimization.Retail,
			OutputType.Lib ));

Result in [Solution Platform] : "DirectX11 x86", "DirectX11 x64", "DirectX12 x86", "DirectX12 x64"

Thank you for making this tool available to all.

Basic tutorial main does not build

In https://github.com/ubisoft/Sharpmake/wiki/Basic-Tutorial#main-function the function Main shadows Sharpmake.MainAttribute, preventing the project to yield a valid solution. I'd suggest to rename the function:

// public static class Main  // Shadows Sharpmake.MainAttributes
public static class BasicsMain
{
    [Main]  // Fails here
    public static void SharpmakeMain(Arguments sharpmakeArgs)
    {
        // Tells Sharpmake to generate the solution described by
        // BasicsSolution.
        sharpmakeArgs.Generate<BasicsSolution>();
    }
}

KitsRoot/Interop issues

I am trying to evaluate Sharpmake and have to confess it's been a painful process so far. I have the application built and written the demo script as per the example in the documentation but when I try and generate my own project using the exe I get issues.
Firstly, I got the error:

Value 'KitsRoot' under registry subKey 'SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' is not set, fallback to default: 'C:\Program Files (x86)\Windows Kits\8.0'

I had Windows Kits 8.1 and 10 so yeah, that would be an issue. I tried setting a registry entry for KitsRoot to point to 8.1 but that didn't work, so I installed the windows8 sdk, only to get:

Could not load file or assembly 'Microsoft.VisualStudio.Setup.Configuration.Interop, Version=1.0.0.0

I have VS2015, VS2017 and VS2019 community editions installed with "normal" options installed, but nothing seems to work. What do I need to have installed for Sharpmake to actually work?

Clang toolset support in VS2019

While trying to generate projects with 'Clang' compiler support, I noticed that the built-in LLVM toolset support in VS2019 is not working when using :
conf.Options.Add(Sharpmake.Options.Vc.General.PlatformToolset.LLVM);

To fix this, I had to make 2 changes in Sharpmake code, making the result identical to what VisualStudio set on a new project with LLVM toolset :

  1. Change the toolset name. Sharpmake currently set 'llvm' in the .vcxprj file but VC2019 expects 'ClangCL'
    ProjectOptionsGenerator.cs : 1133 Options.Option(Options.Vc.General.PlatformToolset.LLVM, () => { context.Options["PlatformToolset"] = "ClangCL"; })
  2. Set the default Clang tool path to '$(LLVMInstallDir)'
    Util.cs : 1739 return GetRegistryLocalMachineSubKeyValue(registryKeyString, null, @"$(LLVMInstallDir)"); // null to get default

It could also be nice of the documentation mentioned how to activate the LLVM toolset.

Errors running bootstrap.bat

Hi. I've been using a branched version of Sharpmake for a few years (I love it). I wanted to get in on the new stuff that's been in development, so I thought I'd get a clean build. However, I can't run the bootstrap.bat without getting the errors. I could solve some of these by force-adding a two NUGet packages, but I ran into more issues and, and that that's not the way to do it anyway.

Any suggestions?

Jens

C:\platforms\Sharpmake>bootstrap.bat
MSBuild batch path: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsMSBuildCmd.bat"


** Visual Studio 2017 MSBuild Command Prompt
** Copyright (c) 2017 Microsoft Corporation


Compiling Sharpmake.Application/Sharpmake.Application.csproj in "Debug|AnyCPU"...
msbuild -t:build -restore "Sharpmake.Application/Sharpmake.Application.csproj" /nologo /verbosity:m /p:Configuration="Debug" /p:Platform="AnyCPU"
Restore completed in 33,02 ms for C:\platforms\Sharpmake\Sharpmake\Sharpmake.csproj.
CSC : error CS8032: An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.EnableConcurrentExecutionAnalyzer cannot be created from C:\Users\jens.nuget\packages\microsoft.codeanalysis.analyzers\3.0.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependen
cies. The system cannot find the file specified.. [C:\platforms\Sharpmake\Sharpmake\Sharpmake.csproj]
...

Can I use Sharpmake and include Cmake projects?

Hey!

I would like to use Sharpmake as a main build system for my project that relies on external code (Ogre3D to be precise) that is built using CMake. Is there a way to tell Sharpmake to take over the CMake part so that I am able to build my own project with Sharpmake and also build the dependencies that are built using CMake?

XCodeProj ignores file-name casing

Casing of file-name is discarded when generating an xcode project. Adding something like below retains it, but I don't think it's a proper solution.

private ProjectFileSystemItem AddInFileSystem(string fullPath, string workspacePath = null, bool applyWorkspaceOnlyToRoot = false)
{
    fullPath = Project.GetCapitalizedFile(fullPath);

Quiet mode

Is there a way to run Sharpmake in Quite mode, ie. suppress all output messages except errors?

solutionFolder doesn't seem to work in AddProject<>

Hi!!

I'm trying to organize the projects in my solution with solution folders and I notice that AddProject<> has a solutionFolder parameter in it. I added a name to it and generated the solution and nothing changed.

Am I doing this wrong?

Thanks for your help!

NuGet for CPP projects

Hello!
Will be there support for NuGet references for C++ projects?
Want to reference D3D12 Agility SDK.

Options.Vc.Compiler.Inline.Disable breaks Visual C++ project files in Visual Studio 2017

Hi,

This is just something I noticed while messing around with Sharpmake at home, with Visual Studio 2017.

If I set the Options.Vc.Compiler.Inline.Disable option on my C++ project, then it breaks the project file because it's writing "Disable" to the relevant value in the .vcxproj file, when Visual Studio is expecting "Disabled".

If I locally modify ProjectOptionsGenerator.cs to write out "Disabled" for that option instead, then it works fine.

Here's a cut down version of the text from the about window of my version of Visual Studio 2017, in case that's relevant:

Microsoft Visual Studio Community 2017
Version 15.6.0
VisualStudio.15.Release/15.6.0+27428.1
Microsoft .NET Framework
Version 4.7.03056

Installed Version: Community

Visual C++ 2017 00369-60000-00001-AA820
Microsoft Visual C++ 2017

Where is Sharpmake.sln?

Hello,

I already used Sharpmake in the past. I would like to build the last version, based on the documentation:
"Open Sharpmake.sln in Visual Studio and compile Sharpmake.Application. Then, in the output folder of the application, take the following binaries and copy them"
Older version contain Sharpmake.sln:
https://github.com/ubisoftinc/Sharpmake/tree/847caccebe97537615d6f3c7b541308bdf64ed33
https://github.com/ubisoftinc/Sharpmake/blob/847caccebe97537615d6f3c7b541308bdf64ed33/Sharpmake.sln
The ~HEAD not:
https://github.com/ubisoftinc/Sharpmake
But I found: "Sharpmake.Main.sharpmake.cs" should I need sharpmake to generate sharpmake solution?

Thanks

Making include/lib paths relative to project directory makes for a confusing time

I'm sure it made sense for the original needs, but taking include paths etc as provided by a script and mangling them in any way means that you have to second guess the system and takes control away from the person creating the script. I spent literally hours trying to work out why my include path of "$(SolutionDir)/../include" was getting turned into "../../../" and getting it wrong. I knew exactly where my include paths were relative to my solution, but Sharpmake thought it knew better. And it didn't. I have modified Sharpmake to not call GetRelativePath on my includes and got them sorted in 2 seconds. Now I need to find why it is making include paths all lower case, which again, might be sensible for the projects that the system was designed for, but I may have capitilisation in my linux paths.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.