Git Product home page Git Product logo

Comments (15)

jspelletier avatar jspelletier commented on September 22, 2024 1

he reproduced the problem and has a fix. this should be merged pretty soon

from sharpmake.

jspelletier avatar jspelletier commented on September 22, 2024

Hi,
There was lots of changes recently for xcode. Could you try some other old versions to see if the problem is the same?

from sharpmake.

greenpeel avatar greenpeel commented on September 22, 2024

I tried downgrading to 0.26 and then 0.24 and the issue occurs on all of them, do you need me to go further back or does that rule out the recent changes?

from sharpmake.

jspelletier avatar jspelletier commented on September 22, 2024

no, the changes are more recent than that.

from sharpmake.

jspelletier avatar jspelletier commented on September 22, 2024

How are you compiling? are you compiling with fastbuild ?

from sharpmake.

greenpeel avatar greenpeel commented on September 22, 2024

Nope, not using fastbuild.

from sharpmake.

greenpeel avatar greenpeel commented on September 22, 2024

I collapsed my project into a single project definition below so that you can see everything it does for Xcode/Mac:

using Sharpmake;
using System.IO;
using System.Xml.Linq;

[Generate]
public class SpirvTools : Project
{
    public SpirvTools()
        : base(typeof(CustomTarget))
    {
       AddTargets(new CustomTarget
                    {
                        Platform = Platform.mac,
                        DevEnv = DevEnv.xcode,
                        BuildConfig = BuildConfig.Debug | BuildConfig.Release | BuildConfig.Distribution
                    });
        
        Name = "SpirvTools";

        IsFileNameToLower = false;
        IsTargetFileNameToLower = false;

        if(Sharpmake.Util.GetExecutingPlatform() == Platform.mac)
        {
            SourceFilesExtensions.Add(".m", ".mm", ".metal", ".plist", ".storyboard", ".xcassets");
            SourceFilesCompileExtensions.Add(".m", ".mm", ".metal", ".storyboard", ".xcassets");
            ResourceFilesExtensions.Add(".storyboard", ".xcassets");
        }

        SourceRootPath = Path.Combine("[project.SharpmakeCsPath]", "vendor/spirv-tools");
        SourceFilesExcludeRegex.Add(Sharpmake.Util.RegexPathCombine("spirv-tools", "source", "link"));
        SourceFilesExcludeRegex.Add(Sharpmake.Util.RegexPathCombine("spirv-tools", "source", "lint"));
        SourceFilesExcludeRegex.Add(Sharpmake.Util.RegexPathCombine("spirv-tools", "source", "diff"));

        // Custom registration for ObjectFileName redirects across all configurations
        AddObjFileRedirect(Path.Combine("source", "val", "basic_block.cpp"), "basic_block_val.obj");
        AddObjFileRedirect(Path.Combine("source", "val", "function.cpp"), "function_val.obj");
        AddObjFileRedirect(Path.Combine("source", "val", "instruction.cpp"), "instruction_val.obj");
    }

    [Configure]
    public void ConfigureGeneral(Configuration conf, CustomTarget target)
    {
        base.ConfigureGeneral(conf, target);

        conf.ProjectPath = "[project.SharpmakeCsPath]";
        conf.SolutionFolder = "Tools";
        conf.IncludePaths.Add(Path.Combine("[project.SharpmakeCsPath]", "vendor/spirv-tools"));
        conf.IncludePaths.Add(Path.Combine("[project.SharpmakeCsPath]", "vendor/spirv-tools/source"));
        conf.IncludePaths.Add(Path.Combine("[project.SharpmakeCsPath]", "vendor/spirv-tools/include"));
        conf.IncludePaths.Add(Path.Combine("[project.SharpmakeCsPath]", "vendor/spirv-tools/include/generated"));
        conf.IncludePaths.Add(Path.Combine("[project.SharpmakeCsPath]", "vendor/spirv-headers/include"));

        conf.Output = Configuration.OutputType.Lib;
        conf.TargetPath = Path.Combine(Globals.RootDir, Util.LibBinDir, "[project.Name]");
        conf.IntermediatePath = Path.Combine(Globals.RootDir, Util.LibIntDir, "[project.Name]");
    }

    [Configure(DevEnv.xcode)]
    public void ConfigureXCode(Configuration conf, CustomTarget target)
    {
        conf.Options.Add(Options.XCode.Compiler.CppLanguageStandard.CPP14);
        conf.Options.Add(Options.XCode.Compiler.OnlyActiveArch.Enable);
    }
}

from sharpmake.

jspelletier avatar jspelletier commented on September 22, 2024

can you paste AddObjFileRedirect code ?

from sharpmake.

greenpeel avatar greenpeel commented on September 22, 2024

Ah yeah sorry, that function looks like this:

        protected void AddObjFileRedirect(string from, string to)
        {
            ObjectFileRedirects[from] = to;
        }

And then it is applied in the base class of a general [Configure] method in the non flattened version of my project by calling this function:

        private void ApplyObjFileRedirects(Configuration conf)
        {
            conf.ObjectFileName = delegate (string from)
            {
                return ObjectFileRedirects.ContainsKey(from) ? Path.Combine("[conf.IntermediatePath]", ObjectFileRedirects[from]) : "";
            };
        }

from sharpmake.

greenpeel avatar greenpeel commented on September 22, 2024

I tried commenting those redirects out and it didn't have any impact on the generated Xcode project.

from sharpmake.

jspelletier avatar jspelletier commented on September 22, 2024

the coworker that does most of the xcode changes is fixing this right now.

from sharpmake.

greenpeel avatar greenpeel commented on September 22, 2024

Awesome, thanks for the speedy response!

from sharpmake.

jspelletier avatar jspelletier commented on September 22, 2024

please try this locally:

    private class ProjectBuildFile : ProjectItem
    {
        public ProjectBuildFile(ProjectFileBase file, string settings = @"")
            : base(ItemSection.PBXBuildFile, file.FullPath, settings)
        {
            File = file;
        }

from sharpmake.

greenpeel avatar greenpeel commented on September 22, 2024

Yep, after applying that patch to XCodeProj.cs the file is included correctly.

from sharpmake.

jspelletier avatar jspelletier commented on September 22, 2024

no official version generated yet but fix has been commited in 4872ee1

from sharpmake.

Related Issues (20)

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.