Skip to content

Commit

Permalink
Merge branch 'macos-fixes' into 'main'
Browse files Browse the repository at this point in the history
Add support for Platform includes on mac.

See merge request Sharpmake/sharpmake!527
  • Loading branch information
baudronp committed Jun 20, 2024
2 parents 0e0edb7 + 210fba7 commit b5533c7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1383,14 +1383,17 @@ private IEnumerable<string> GetIncludePathsImpl(IGenerationContext context)
includePaths.AddRange(conf.IncludePrivatePaths);
includePaths.AddRange(conf.IncludePaths);
includePaths.AddRange(conf.DependenciesIncludePaths);
includePaths.AddRange(conf.IncludeSystemPaths);
includePaths.AddRange(conf.DependenciesIncludeSystemPaths);

includePaths.Sort();
return includePaths;
}

private IEnumerable<IncludeWithPrefix> GetPlatformIncludePathsWithPrefixImpl(IGenerationContext context)
{
yield break;
const string cmdLineIncludePrefix = "-isystem";
return context.Configuration.DependenciesIncludeSystemPaths.Select(includePath => new IncludeWithPrefix(cmdLineIncludePrefix, includePath));
}

private IEnumerable<string> GetResourceIncludePathsImpl(IGenerationContext context)
Expand Down
1 change: 1 addition & 0 deletions samples/HelloXCode/codebase/dll1/dll1.sharpmake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public override void ConfigureAll(Configuration conf, CommonTarget target)
conf.IncludePaths.Add(SourceRootPath);

conf.AddPrivateDependency<StaticLib1Project>(target);
conf.IncludeSystemPaths.Add("[project.SourceRootPath]/systemincludedll");
}

public override void ConfigureMac(Configuration conf, CommonTarget target)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
inline void SystemIncludeDllFct()
{

}
1 change: 1 addition & 0 deletions samples/HelloXCode/codebase/exe/exe.sharpmake.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public override void ConfigureAll(Configuration conf, CommonTarget target)
conf.AddPrivateDependency<StaticLib2Project>(target);

conf.Defines.Add("CREATION_DATE=\"July 2020\"");
conf.IncludeSystemPaths.Add("[project.SourceRootPath]/systeminclude");
}
}
}
4 changes: 4 additions & 0 deletions samples/HelloXCode/codebase/exe/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "sub folder/useless_static_lib2.h"

#include <external.h>
#include "systeminclude.h"
#include "systemincludedll.h"

int main(int, char**)
{
Expand All @@ -21,5 +23,7 @@ int main(int, char**)
Util2 utilityStatic;
utilityStatic.DoSomethingUseful();
StaticLib2::UselessMethod();
SystemFct();
SystemIncludeDllFct();
return 0;
}
5 changes: 5 additions & 0 deletions samples/HelloXCode/codebase/exe/systeminclude/systeminclude.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Dummy file
inline void SystemFct()
{

}

0 comments on commit b5533c7

Please sign in to comment.