Create a MSVSProject object for the targets found in target list. Arguments: target_list: the list of targets to generate project objects for. target_dicts: the dictionary of specifications. options: global generator options. msvs_version: the MSVSVersion object. Ret
(target_list, target_dicts, options, msvs_version)
| 1905 | |
| 1906 | |
| 1907 | def _CreateProjectObjects(target_list, target_dicts, options, msvs_version): |
| 1908 | """Create a MSVSProject object for the targets found in target list. |
| 1909 | |
| 1910 | Arguments: |
| 1911 | target_list: the list of targets to generate project objects for. |
| 1912 | target_dicts: the dictionary of specifications. |
| 1913 | options: global generator options. |
| 1914 | msvs_version: the MSVSVersion object. |
| 1915 | Returns: |
| 1916 | A set of created projects, keyed by target. |
| 1917 | """ |
| 1918 | global fixpath_prefix |
| 1919 | # Generate each project. |
| 1920 | projects = {} |
| 1921 | for qualified_target in target_list: |
| 1922 | spec = target_dicts[qualified_target] |
| 1923 | proj_path, fixpath_prefix = _GetPathOfProject( |
| 1924 | qualified_target, spec, options, msvs_version |
| 1925 | ) |
| 1926 | guid = _GetGuidOfProject(proj_path, spec) |
| 1927 | overrides = _GetPlatformOverridesOfProject(spec) |
| 1928 | build_file = gyp.common.BuildFile(qualified_target) |
| 1929 | # Create object for this project. |
| 1930 | target_name = spec["target_name"] |
| 1931 | if spec["toolset"] == "host": |
| 1932 | target_name += "_host" |
| 1933 | obj = MSVSNew.MSVSProject( |
| 1934 | proj_path, |
| 1935 | name=target_name, |
| 1936 | guid=guid, |
| 1937 | spec=spec, |
| 1938 | build_file=build_file, |
| 1939 | config_platform_overrides=overrides, |
| 1940 | fixpath_prefix=fixpath_prefix, |
| 1941 | ) |
| 1942 | # Set project toolset if any (MS build only) |
| 1943 | if msvs_version.UsesVcxproj(): |
| 1944 | obj.set_msbuild_toolset( |
| 1945 | _GetMsbuildToolsetOfProject(proj_path, spec, msvs_version) |
| 1946 | ) |
| 1947 | projects[qualified_target] = obj |
| 1948 | # Set all the dependencies, but not if we are using an external builder like |
| 1949 | # ninja |
| 1950 | for project in projects.values(): |
| 1951 | if not project.spec.get("msvs_external_builder"): |
| 1952 | deps = project.spec.get("dependencies", []) |
| 1953 | deps = [projects[d] for d in deps] |
| 1954 | project.set_dependencies(deps) |
| 1955 | return projects |
| 1956 | |
| 1957 | |
| 1958 | def _InitNinjaFlavor(params, target_list, target_dicts): |
no test coverage detected