(spec, version, guid, gyp_file_name)
| 2924 | |
| 2925 | |
| 2926 | def _GetMSBuildGlobalProperties(spec, version, guid, gyp_file_name): |
| 2927 | namespace = os.path.splitext(gyp_file_name)[0] |
| 2928 | properties = [ |
| 2929 | [ |
| 2930 | "PropertyGroup", |
| 2931 | {"Label": "Globals"}, |
| 2932 | ["ProjectGuid", guid], |
| 2933 | ["Keyword", "Win32Proj"], |
| 2934 | ["RootNamespace", namespace], |
| 2935 | ["IgnoreWarnCompileDuplicatedFilename", "true"], |
| 2936 | ] |
| 2937 | ] |
| 2938 | |
| 2939 | if ( |
| 2940 | os.environ.get("PROCESSOR_ARCHITECTURE") == "AMD64" |
| 2941 | or os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64" |
| 2942 | ): |
| 2943 | properties[0].append(["PreferredToolArchitecture", "x64"]) |
| 2944 | |
| 2945 | if spec.get("msvs_target_platform_version"): |
| 2946 | target_platform_version = spec.get("msvs_target_platform_version") |
| 2947 | properties[0].append(["WindowsTargetPlatformVersion", target_platform_version]) |
| 2948 | if spec.get("msvs_target_platform_minversion"): |
| 2949 | target_platform_minversion = spec.get("msvs_target_platform_minversion") |
| 2950 | properties[0].append( |
| 2951 | ["WindowsTargetPlatformMinVersion", target_platform_minversion] |
| 2952 | ) |
| 2953 | else: |
| 2954 | properties[0].append( |
| 2955 | ["WindowsTargetPlatformMinVersion", target_platform_version] |
| 2956 | ) |
| 2957 | |
| 2958 | if spec.get("msvs_enable_winrt"): |
| 2959 | properties[0].append(["DefaultLanguage", "en-US"]) |
| 2960 | properties[0].append(["AppContainerApplication", "true"]) |
| 2961 | if spec.get("msvs_application_type_revision"): |
| 2962 | app_type_revision = spec.get("msvs_application_type_revision") |
| 2963 | properties[0].append(["ApplicationTypeRevision", app_type_revision]) |
| 2964 | else: |
| 2965 | properties[0].append(["ApplicationTypeRevision", "8.1"]) |
| 2966 | if spec.get("msvs_enable_winphone"): |
| 2967 | properties[0].append(["ApplicationType", "Windows Phone"]) |
| 2968 | else: |
| 2969 | properties[0].append(["ApplicationType", "Windows Store"]) |
| 2970 | |
| 2971 | platform_name = None |
| 2972 | msvs_windows_sdk_version = None |
| 2973 | for configuration in spec["configurations"].values(): |
| 2974 | platform_name = platform_name or _ConfigPlatform(configuration) |
| 2975 | msvs_windows_sdk_version = ( |
| 2976 | msvs_windows_sdk_version |
| 2977 | or _ConfigWindowsTargetPlatformVersion(configuration, version) |
| 2978 | ) |
| 2979 | if platform_name and msvs_windows_sdk_version: |
| 2980 | break |
| 2981 | if msvs_windows_sdk_version: |
| 2982 | properties[0].append( |
| 2983 | ["WindowsTargetPlatformVersion", str(msvs_windows_sdk_version)] |
no test coverage detected