Example #1
0
        /// <summary>
        /// We parse the librarian settings, ie link options for libraries.
        /// </summary>
        private void parseConfiguration_LibrarianSettings(VCConfiguration vcConfiguration, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // We get the librarian 'tool'...
            IVCCollection   tools         = Utils.call(() => (vcConfiguration.Tools as IVCCollection));
            VCLibrarianTool librarianTool = Utils.call(() => (tools.Item("VCLibrarianTool") as VCLibrarianTool));

            if (librarianTool == null)
            {
                // Not all projects have a librarian tool...
                return;
            }

            // We find if this library is set to link together other libraries it depends on...
            // (We are assuming that all configurations of the project have the same link-library-dependencies setting.)
            m_projectInfo.LinkLibraryDependencies = Utils.call(() => (librarianTool.LinkLibraryDependencies));

            // - Target Machine (TODO: complete the machine type)

            string platform = Utils.call(() => (vcConfiguration.Evaluate("$(Platform)")));

            if (!string.IsNullOrEmpty(platform))
            {
                configurationInfo.Platform = platform;
                configurationInfo.addLinkerFlag("/MACHINE:X64");
            }

            // - Import Library
            configurationInfo.DynamicLibOutputPath = configurationInfo.OutputFolderAbsolute + m_projectInfo.Name + ".lib";
        }
Example #2
0
 private void DisableLibrarianConfig(ref VCLibrarianTool librarianTool, string config)
 {
     if (librarianTool != null)
     {
         Log("\tLibrarian Configuration");
         if (librarianTool.AdditionalOptions != null)
         {
             string newargs = DisableCodeCoverageCommandLineArguments(librarianTool.AdditionalOptions);
             if (librarianTool.AdditionalOptions != newargs)
             {
                 librarianTool.AdditionalOptions = newargs;
                 Log("\t\tAdditional command line arguments set to '" + newargs + "'");
             }
         }
     }
 }
Example #3
0
        /// <summary>
        /// We parse the librarian settings, ie link options for libraries.
        /// </summary>
        private void parseConfiguration_LibrarianSettings(VCConfiguration vcConfiguration, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // We get the librarian 'tool'...
            IVCCollection   tools         = Utils.call(() => (vcConfiguration.Tools as IVCCollection));
            VCLibrarianTool librarianTool = Utils.call(() => (tools.Item("VCLibrarianTool") as VCLibrarianTool));

            if (librarianTool == null)
            {
                // Not all projects have a librarian tool...
                return;
            }

            // We find if this library is set to link together other libraries it depends on...
            // (We are assuming that all configurations of the project have the same link-library-dependencies setting.)
            m_projectInfo.LinkLibraryDependencies = Utils.call(() => (librarianTool.LinkLibraryDependencies));
        }
Example #4
0
 private void CreateLibrarianConfig(ref VCLibrarianTool librarianTool, List <string> additionalParamsList, string config)
 {
     if (librarianTool != null)
     {
         Log("\tLibrarian Configuration");
         if (librarianTool.AdditionalOptions == null)
         {
             librarianTool.AdditionalOptions = " ";
         }
         string additionalParams = generateParamString(additionalParamsList, librarianTool.AdditionalOptions);
         if (additionalParams.Length > 0)
         {
             librarianTool.AdditionalOptions += " " + additionalParams;
             Log("\t\tAdditional command line arguments '" + additionalParams + "' are appended");
         }
     }
 }
Example #5
0
        public void DisableTestCocoonConfig(String config, string project)
        {
            bool foundProject = false;

            IEnumerator e = GetVCProjectRefs();

            e.Reset();
            // traverse all projects to find the right one
            while (e.MoveNext())
            {
                VCProject actVCP = (VCProject)e.Current;
                if (actVCP.Name == project)
                {
                    foundProject = true;
                    VCConfiguration vcC;
                    vcC = (VCConfiguration)(((IVCCollection)actVCP.Configurations).Item(config));
                    if (vcC != null)
                    {
                        Log("Modifying configuration '" + config + "' for the project '" + project + "'");

                        // change settings for sepcified compiler
                        IVCCollection ctools = (IVCCollection)vcC.Tools;

                        VCLinkerTool      linkerTool      = (VCLinkerTool)(ctools.Item("VCLinkerTool"));
                        VCLibrarianTool   librarianTool   = (VCLibrarianTool)(ctools.Item("VCLibrarianTool"));
                        VCCLCompilerTool  compilerTool    = (VCCLCompilerTool)(ctools.Item("VCCLCompilerTool"));
                        VCCustomBuildTool customBuildTool = (VCCustomBuildTool)(ctools.Item("VCCustomBuildTool"));

                        DisableClConfig(ref compilerTool, config);
                        DisableLinkConfig(ref linkerTool, config);
                        DisableCustomBuildConfig(ref customBuildTool, config);
                        DisableLibrarianConfig(ref librarianTool, config);
                        DisableConfigForEachFile(ref actVCP, config);
                    }
                    else
                    {
                        Log("Skipping configuration '" + config + "' for the project '" + project + "'");
                    }
                }
            }
            if (!foundProject)
            {
                ShowMessageBox("Could not find the project", "Warning");
            }
        }
Example #6
0
        /// <summary>
        /// Finds the library path for the configuration passed in.
        /// </summary>
        private void parseLibrarianSettings_LibraryPath(VCConfiguration vcConfiguration, VCLibrarianTool librarianTool, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // We:
            // 1. Read the additional library paths (which are in a semi-colon-delimited string)
            // 2. Split it into separate paths
            // 3. Resolve any symbols
            // 4. Make sure all paths are relative to the project root folder

            // 1 & 2...
            string strAdditionalLibraryDirectories = Utils.call(() => (librarianTool.AdditionalLibraryDirectories));
            if (strAdditionalLibraryDirectories == null)
            {
                return;
            }

            List<string> additionalLibraryDirectories = Utils.split(strAdditionalLibraryDirectories, ';', ',');
            foreach (string additionalLibraryDirectory in additionalLibraryDirectories)
            {
                // The string may be quoted. We need to remove the quotes...
                string unquotedLibraryDirectory = additionalLibraryDirectory.Trim('"');
                if (unquotedLibraryDirectory == "")
                {
                    continue;
                }

                // 3 & 4...
                string resolvedPath = Utils.call(() => (vcConfiguration.Evaluate(unquotedLibraryDirectory)));
                if (resolvedPath != "")
                {
                    string relativePath = Utils.makeRelativePath(m_projectInfo.RootFolderAbsolute, resolvedPath);
                    configurationInfo.addLibraryPath(relativePath);
                }
            }
        }
Example #7
0
        /// <summary>
        /// Finds the collection of additional libraries to link into this project.
        /// </summary>
        private void parseLibrarianSettings_Libraries(VCConfiguration vcConfiguration, VCLibrarianTool librarianTool, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // The collection of libraries is stored in a space-delimited string...
            string strAdditionalLibraries = Utils.call(() => (librarianTool.AdditionalDependencies));
            if (strAdditionalLibraries == null)
            {
                return;
            }

            List<string> additionalLibraries = Utils.split(strAdditionalLibraries, ' ');
            foreach (string additionalLibrary in additionalLibraries)
            {
                // We add the library to the project...
                string rawName = Path.GetFileNameWithoutExtension(additionalLibrary);
                configurationInfo.addLibraryRawName(rawName);
            }
        }
Example #8
0
        public void CreateTestCocoonConfig(String config, string project, List <string> additionalParamsList, List <string> additiona_includes, bool QtConfiguration)
        {
            bool foundProject = false;

            IEnumerator ProjectsEnumaror = GetVCProjectRefs();

            ProjectsEnumaror.Reset();
            // traverse all projects to find the right one
            while (ProjectsEnumaror.MoveNext())
            {
                VCProject actVCP = (VCProject)ProjectsEnumaror.Current;
                if (actVCP.Name == project)
                {
                    foundProject = true;
                    VCConfiguration vcC = null;
                    //vcC = (VCConfiguration)(((IVCCollection)actVCP.Configurations).Item(config));
                    IEnumerator ConfigurationEnumarator = ((IVCCollection)actVCP.Configurations).GetEnumerator();
                    for (ConfigurationEnumarator.Reset(); ConfigurationEnumarator.MoveNext();)
                    {
                        vcC = ConfigurationEnumarator.Current as VCConfiguration;
                        if ((vcC != null) && (vcC.ConfigurationName == config))
                        {
                            Log("Modifying configuration '" + config + "' for the project '" + project + "' for the platform '" + vcC.Name + "'");

                            // change settings for sepcified compiler
                            IVCCollection ctools = (IVCCollection)vcC.Tools;

                            VCActiveXReference  cVCActiveXReference  = ctools.Item("VCActiveXReference") as VCActiveXReference;
                            VCALinkTool         cVCALinkTool         = ctools.Item("VCALinkTool") as VCALinkTool;
                            VCAppVerifierTool   cVCAppVerifierTool   = ctools.Item("VCAppVerifierTool") as VCAppVerifierTool;
                            VCAssemblyReference cVCAssemblyReference = ctools.Item("VCAssemblyReference") as VCAssemblyReference;
                            VCBscMakeTool       cVCBscMakeTool       = ctools.Item("VCBscMakeTool") as VCBscMakeTool;
                            VCCLCompilerTool    cVCCLCompilerTool    = ctools.Item("VCCLCompilerTool") as VCCLCompilerTool;
                            VCConfiguration     cVCConfiguration     = ctools.Item("VCConfiguration") as VCConfiguration;
                            VCCustomBuildRule   cVCCustomBuildRule   = ctools.Item("VCCustomBuildRule") as VCCustomBuildRule;
                            VCCustomBuildTool   cVCCustomBuildTool   = ctools.Item("VCCustomBuildTool") as VCCustomBuildTool;
                            VCDebugSettings     cVCDebugSettings     = ctools.Item("VCDebugSettings") as VCDebugSettings;
                            VCFile cVCFile = ctools.Item("VCFile") as VCFile;
                            VCFileConfiguration            cVCFileConfiguration            = ctools.Item("VCFileConfiguration") as VCFileConfiguration;
                            VCFilter                       cVCFilter                       = ctools.Item("VCFilter") as VCFilter;
                            VCFxCopTool                    cVCFxCopTool                    = ctools.Item("VCFxCopTool") as VCFxCopTool;
                            VCLibrarianTool                cVCLibrarianTool                = ctools.Item("VCLibrarianTool") as VCLibrarianTool;
                            VCLinkerTool                   cVCLinkerTool                   = ctools.Item("VCLinkerTool") as VCLinkerTool;
                            VCManagedResourceCompilerTool  cVCManagedResourceCompilerTool  = ctools.Item("VCManagedResourceCompilerTool") as VCManagedResourceCompilerTool;
                            VCManifestTool                 cVCManifestTool                 = ctools.Item("VCManifestTool") as VCManifestTool;
                            VCMidlTool                     cVCMidlTool                     = ctools.Item("VCMidlTool") as VCMidlTool;
                            VCNMakeTool                    cVCNMakeTool                    = ctools.Item("VCNMakeTool") as VCNMakeTool;
                            VCPlatform                     cVCPlatform                     = ctools.Item("VCPlatform") as VCPlatform;
                            VCPostBuildEventTool           cVCPostBuildEventTool           = ctools.Item("VCPostBuildEventTool") as VCPostBuildEventTool;
                            VCPreBuildEventTool            cVCPreBuildEventTool            = ctools.Item("VCPreBuildEventTool") as VCPreBuildEventTool;
                            VCPreLinkEventTool             cVCPreLinkEventTool             = ctools.Item("VCPreLinkEventTool") as VCPreLinkEventTool;
                            VCProject                      cVCProject                      = ctools.Item("VCProject") as VCProject;
                            VCProjectEngine                cVCProjectEngine                = ctools.Item("VCProjectEngine") as VCProjectEngine;
                            VCProjectEngineEvents          cVCProjectEngineEvents          = ctools.Item("VCProjectEngineEvents") as VCProjectEngineEvents;
                            VCProjectEngineObject          cVCProjectEngineObject          = ctools.Item("VCProjectEngineObject") as VCProjectEngineObject;
                            VCProjectItem                  cVCProjectItem                  = ctools.Item("VCProjectItem") as VCProjectItem;
                            VCProjectReference             cVCProjectReference             = ctools.Item("VCProjectReference") as VCProjectReference;
                            VCPropertySheet                cVCPropertySheet                = ctools.Item("VCPropertySheet") as VCPropertySheet;
                            VCReference                    cVCReference                    = ctools.Item("VCReference") as VCReference;
                            VCReferences                   cVCReferences                   = ctools.Item("VCReferences") as VCReferences;
                            VCResourceCompilerTool         cVCResourceCompilerTool         = ctools.Item("VCResourceCompilerTool") as VCResourceCompilerTool;
                            VCRuntimeBooleanProperty       cVCRuntimeBooleanProperty       = ctools.Item("VCRuntimeBooleanProperty") as VCRuntimeBooleanProperty;
                            VCRuntimeEnumProperty          cVCRuntimeEnumProperty          = ctools.Item("VCRuntimeEnumProperty") as VCRuntimeEnumProperty;
                            VCRuntimeEnumValue             cVCRuntimeEnumValue             = ctools.Item("VCRuntimeEnumValue") as VCRuntimeEnumValue;
                            VCRuntimeIntegerProperty       cVCRuntimeIntegerProperty       = ctools.Item("VCRuntimeIntegerProperty") as VCRuntimeIntegerProperty;
                            VCRuntimeProperty              cVCRuntimeProperty              = ctools.Item("VCRuntimeProperty") as VCRuntimeProperty;
                            VCRuntimeStringProperty        cVCRuntimeStringProperty        = ctools.Item("VCRuntimeStringProperty") as VCRuntimeStringProperty;
                            VCToolFile                     cVCToolFile                     = ctools.Item("VCToolFile") as VCToolFile;
                            VCUserMacro                    cVCUserMacro                    = ctools.Item("VCUserMacro") as VCUserMacro;
                            VCWebDeploymentTool            cVCWebDeploymentTool            = ctools.Item("VCWebDeploymentTool") as VCWebDeploymentTool;
                            VCWebServiceProxyGeneratorTool cVCWebServiceProxyGeneratorTool = ctools.Item("VCWebServiceProxyGeneratorTool") as VCWebServiceProxyGeneratorTool;
                            VCXDCMakeTool                  cVCXDCMakeTool                  = ctools.Item("VCXDCMakeTool") as VCXDCMakeTool;
                            VCXMLDataGeneratorTool         cVCXMLDataGeneratorTool         = ctools.Item("VCXMLDataGeneratorTool") as VCXMLDataGeneratorTool;

                            VCLinkerTool      linkerTool                    = ctools.Item("VCLinkerTool") as VCLinkerTool;
                            VCLibrarianTool   librarianTool                 = ctools.Item("VCLibrarianTool") as VCLibrarianTool;
                            VCCLCompilerTool  compilerTool                  = ctools.Item("VCCLCompilerTool") as VCCLCompilerTool;
                            VCCustomBuildTool customBuildTool               = ctools.Item("VCCustomBuildTool") as VCCustomBuildTool;
                            string            libgen                        = FindCslibConfig(ref compilerTool);
                            List <string>     additionalParamsListLink      = new List <string>(additionalParamsList);
                            List <string>     additionalParamsListLibrarian = new List <string>(additionalParamsList);
                            if (libgen != null)
                            {
                                additionalParamsListLink.Add("--cs-libgen=" + libgen);
                                additionalParamsListLibrarian.Add("--cs-libgen=" + libgen);
                            }

                            if (compilerTool != null)
                            {
                                CreateClConfig(ref compilerTool, additionalParamsList, additiona_includes, actVCP.ProjectDirectory, config);
                            }
                            if (linkerTool != null)
                            {
                                CreateLinkConfig(ref linkerTool, additionalParamsListLink, config);
                            }
                            if (customBuildTool != null)
                            {
                                CreateCustomBuildConfig(ref customBuildTool, additionalParamsList, config);
                            }
                            if (librarianTool != null)
                            {
                                CreateLibrarianConfig(ref librarianTool, additionalParamsListLibrarian, config);
                            }
                            if (actVCP != null)
                            {
                                CreateConfigForEachFile(ref actVCP, additionalParamsList, config);
                            }
                        }
                    }
                }
            }
            if (!foundProject)
            {
                ShowMessageBox("Could not find the project", "Warning");
            }
        }
Example #9
0
        /****************************************************************/
        #endregion /* LifeCycle */

        #region Public Operations
        /****************************************************************/
        public void ParseVcproj()
        {
            //this specifies the name of the 'rm -f' or equivalent command
            string rm = "rm -f -v";

            //this specifies the default name for the dependencies file
            string dependencies = ".dependencies";
            string cflags       = "";
            string ldflags      = "";
            string libs         = "";


            m_MakFWriter.WriteLine("# Makefile - {0}", m_ProjectName);
            m_MakFWriter.WriteLine();

            //get the project name
            dependencies = m_ProjectName + ".dep";

            //catch the default configuration definition = first configuration in vcproj configurations
            m_MakFWriter.WriteLine("ifndef CFG");
            m_MakFWriter.WriteLine("CFG={0}", ((VCConfiguration)m_ConfigCollection.Item(1)).ConfigurationName);
            m_MakFWriter.WriteLine("endif");

            //print the C++ compiler definition
            m_MakFWriter.WriteLine("CC=gcc");

            if (m_PlatfromName.Equals("Win32"))
            {
                m_MakFWriter.WriteLine("CFLAGS=-m32 -fpic");
            }
            else
            {
                m_MakFWriter.WriteLine("CFLAGS=-m64 -fpic");
            }
            m_MakFWriter.WriteLine("CXX=g++");
            m_MakFWriter.WriteLine("CXXFLAGS=$(CFLAGS)");

            #region Config Parsing
            /**********************************/
            foreach (VCConfiguration config in m_ConfigCollection)
            {
                //print else for "$(CFG)" section in case it is not first config in makefile
                //if (0 != m_NumOfConfigs)
                //{
                //    m_MakFWriter.WriteLine("else");
                //} //TODO:check this issue

                //print ifeq "$(CFG)" "CONFIG_NAME"
                m_MakFWriter.WriteLine("ifeq \"$(CFG)\" \"{0}\"", config.ConfigurationName);

                IVCCollection toolsCollection = (IVCCollection)config.Tools;

                #region VCCLCompilerTool
                /**********************************/
                VCCLCompilerTool compTool = (VCCLCompilerTool)toolsCollection.Item("VCCLCompilerTool");

                if (null != compTool)
                {
                    cflags = iCreateCflags(compTool);


                    //add special include path for VTOC files
                    for (int i = 0; i < m_VcProjDependencies.Length; i++)
                    {
                        if (m_VcProjDependencies[i].Equals("v_to_c"))
                        {
                            cflags += " -I VTOC/share/include";
                        }
                    }

                    m_MakFWriter.WriteLine("CFLAGS+={0}", cflags);
                }
                /**********************************/
                #endregion VCCLCompilerTool

                #region VCLinkerTool
                /**********************************/
                VCLinkerTool lnkTool = (VCLinkerTool)toolsCollection.Item("VCLinkerTool");
                if (null != lnkTool)
                {
                    if ((m_TargetDictionary[config.ConfigurationName].ExeFlag) ||
                        (m_TargetDictionary[config.ConfigurationName].DllFlag))
                    {
                        m_MakFWriter.WriteLine("LD=$(CXX) $(CXXFLAGS)");
                    }

                    m_MakFWriter.WriteLine("LDFLAGS=");

                    libs    = iCreateLibs(lnkTool);
                    ldflags = iCreateLdflags(lnkTool);

                    m_MakFWriter.WriteLine("LDFLAGS+={0}", ldflags);
                    if (m_TargetDictionary[config.ConfigurationName].ExeFlag)
                    {
                        m_MakFWriter.WriteLine("LIBS+={0}", libs);
                    }
                    if (m_TargetDictionary[config.ConfigurationName].DllFlag)
                    {
                        m_MakFWriter.WriteLine("LIBS+= -shared {0}", libs);
                    }
                }

                /**********************************/
                #endregion VCLinkerTool

                #region VCLibrarianTool
                /**********************************/
                VCLibrarianTool libTool = (VCLibrarianTool)toolsCollection.Item("VCLibrarianTool");

                if (null != libTool)
                {
                    m_MakFWriter.WriteLine("AR=ar");
                    m_MakFWriter.WriteLine("ARFLAGS=rus");
                }
                /**********************************/
                #endregion VCLibrarianTool

                //print target for each configuration
                iPrintTARGET2Makefile(config.ConfigurationName);
            }

            //close every ifeq "$(CFG)" with endif
            for (int i = 0; i < m_NumOfConfigs; i++)
            {
                m_MakFWriter.WriteLine("endif");
            }
            /**********************************/
            #endregion Config Parsing

            //print default target for first configuration in configCollection
            iPrintTARGET2Makefile(((VCConfiguration)m_ConfigCollection.Item(1)).ConfigurationName);

            //print the default target and the suffix rules
            m_MakFWriter.WriteLine(".PHONY: all");
            m_MakFWriter.WriteLine("all: $(TARGET)");
            m_MakFWriter.WriteLine("");

            m_MakFWriter.WriteLine("%.o: %.c");
            m_MakFWriter.WriteLine("\t$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<");
            m_MakFWriter.WriteLine("");

            m_MakFWriter.WriteLine("%.o: %.cc");
            m_MakFWriter.WriteLine("\t$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<");
            m_MakFWriter.WriteLine("");

            m_MakFWriter.WriteLine("%.o: %.cpp");
            m_MakFWriter.WriteLine("\t$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<");
            m_MakFWriter.WriteLine("");

            m_MakFWriter.WriteLine("%.o: %.cxx");
            m_MakFWriter.WriteLine("\t$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $<");
            m_MakFWriter.WriteLine("");

            m_MakFWriter.WriteLine("%.res: %.rc");
            m_MakFWriter.WriteLine("\t$(RC) $(CPPFLAGS) -o $@ -i $<");
            m_MakFWriter.WriteLine("");

            #region Sources
            /**********************************/
            iPrintGroupsAndSources();
            /**********************************/
            #endregion Sources

            //define the objects automatically from the sources in the Makefile
            m_MakFWriter.WriteLine("OBJS=$(patsubst %.rc,%.res,$(patsubst %.cxx,%.o,$(patsubst %.cpp,%.o,$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(filter %.c %.cc %.cpp %.cxx %.rc,$(SRCS)))))))");
            m_MakFWriter.WriteLine("");

            //print the target rule, according to the type of deafult target = target of first configuration in vcproj configurations list
            m_MakFWriter.WriteLine("$(TARGET): $(OBJS)");
            VcTargetType target = m_TargetDictionary[((VCConfiguration)m_ConfigCollection.Item(1)).ConfigurationName];
            if (target.ExeFlag)
            {
                m_MakFWriter.WriteLine("\t$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)");
            }
            if (target.DllFlag)
            {
                m_MakFWriter.WriteLine("\t$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)");
            }
            if (target.LibFlag)
            {
                m_MakFWriter.WriteLine("\t$(AR) $(ARFLAGS) $@ $(OBJS)");
            }
            m_MakFWriter.WriteLine("");

            // print the 'clean' target rule
            m_MakFWriter.WriteLine(".PHONY: clean");
            m_MakFWriter.WriteLine("clean:");
            m_MakFWriter.WriteLine("\t-{0} $(OBJS) $(TARGET) {1}", rm, dependencies);
            m_MakFWriter.WriteLine("");

            // print the 'depends' target rule for automatic dependencies generation
            m_MakFWriter.WriteLine(".PHONY: depends");
            m_MakFWriter.WriteLine("depends:");
            m_MakFWriter.WriteLine("\t-$(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM $(filter %.c %.cc %.cpp %.cxx,$(SRCS)) > {0}", dependencies);
            m_MakFWriter.WriteLine("");

            m_MakFWriter.WriteLine("-include {0}", dependencies);
            m_MakFWriter.WriteLine("");

            m_MakFWriter.Close();

            iFixMakfile();
        }
        /// <summary>
        /// Finds the collection of additional libraries to link into this project.
        /// </summary>
        private void parseLibrarianSettings_Libraries(VCConfiguration vcConfiguration, VCLibrarianTool librarianTool, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // The collection of libraries is stored in a space-delimited string...
            string strAdditionalLibraries = Utils.call(() => (librarianTool.AdditionalDependencies));

            if (strAdditionalLibraries == null)
            {
                return;
            }

            List <string> additionalLibraries = Utils.split(strAdditionalLibraries, ' ');

            foreach (string additionalLibrary in additionalLibraries)
            {
                // We add the library to the project...
#if false
                string rawName = Path.GetFileNameWithoutExtension(additionalLibrary);
#else
                var rawName = Utils.convertLinuxLibraryNameToRawName(additionalLibrary);
#endif
                configurationInfo.addLibraryRawName(rawName);
            }
        }
        /// <summary>
        /// Finds the library path for the configuration passed in.
        /// </summary>
        private void parseLibrarianSettings_LibraryPath(VCConfiguration vcConfiguration, VCLibrarianTool librarianTool, ProjectConfigurationInfo_CPP configurationInfo)
        {
            // We:
            // 1. Read the additional library paths (which are in a semi-colon-delimited string)
            // 2. Split it into separate paths
            // 3. Resolve any symbols
            // 4. Make sure all paths are relative to the project root folder

            // 1 & 2...
            string strAdditionalLibraryDirectories = Utils.call(() => (librarianTool.AdditionalLibraryDirectories));

            if (strAdditionalLibraryDirectories == null)
            {
                return;
            }

            List <string> additionalLibraryDirectories = Utils.split(strAdditionalLibraryDirectories, ';', ',');

            foreach (string additionalLibraryDirectory in additionalLibraryDirectories)
            {
                // The string may be quoted. We need to remove the quotes...
                string unquotedLibraryDirectory = additionalLibraryDirectory.Trim('"');
                if (unquotedLibraryDirectory == "")
                {
                    continue;
                }

                // 3 & 4...
                string resolvedPath = Utils.call(() => (vcConfiguration.Evaluate(unquotedLibraryDirectory)));
                if (resolvedPath != "")
                {
                    string relativePath = Utils.makeRelativePath(m_projectInfo.RootFolderAbsolute, resolvedPath);
                    configurationInfo.addLibraryPath(relativePath);
                }
            }
        }
Example #12
0
 private void DisableLibrarianConfig(ref VCLibrarianTool librarianTool, string config)
 {
     if (librarianTool != null)
       {
     Log("\tLibrarian Configuration");
     if (librarianTool.AdditionalOptions != null)
     {
       string newargs = DisableCodeCoverageCommandLineArguments(librarianTool.AdditionalOptions);
       if (librarianTool.AdditionalOptions != newargs)
       {
     librarianTool.AdditionalOptions = newargs;
     Log("\t\tAdditional command line arguments set to '" + newargs + "'");
       }
     }
       }
 }
Example #13
0
 private void CreateLibrarianConfig(ref VCLibrarianTool librarianTool, List<string> additionalParamsList, string config)
 {
     if (librarianTool != null)
       {
     Log("\tLibrarian Configuration");
     if (librarianTool.AdditionalOptions == null)
       librarianTool.AdditionalOptions = " ";
     string additionalParams = generateParamString(additionalParamsList, librarianTool.AdditionalOptions);
     if (additionalParams.Length > 0)
     {
       librarianTool.AdditionalOptions += " " + additionalParams;
       Log("\t\tAdditional command line arguments '" + additionalParams + "' are appended");
     }
       }
 }