@@ -75,8 +75,51 @@ msbuild "D:\ConsoleApplication2\ConsoleApplication2.vcxproj" -p:Configuration=Re
7575msbuild "D:\ConsoleApplication2\ConsoleApplication2.vcxproj" -p:Configuration=Release;Platform=x64
7676
7777```
78+ ## 2.4. 全局支持的属性
79+ ### 2.4.1. PlatformToolset 全局属性
80+ 工具集,目前支持` YY_Cross_Clang_1_0 ` 、` YY_Cross_GCC_1_0 ` 。
81+
82+ 示例:
83+ ``` xml
84+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Debug|x86'" Label =" Configuration" >
85+ <PlatformToolset >YY_Cross_GCC_1_0</PlatformToolset >
86+ </PropertyGroup >
87+ ```
88+ ### 2.4.2. Platform 全局属性
89+ 一般来说,Platform拥有以下几种可能:
90+ * ARM
91+ * ARM64
92+ * MIPS
93+ * x64
94+ * x86
95+
96+ > 注意:Platform是在调用msbuild时传入的,一般不应该直接设置到工程。
97+
98+ ### 2.4.3. PlatformTriplet 全局属性
99+ 平台的Triplet值,比如说:i686-linux-gnu。一般无需设置,框架会根据Platform属性自动调整。
100+ 其默认对照关系如下:
101+
102+ | Platform | Linux PlatformTriplet 默认值 | MacOS PlatformTriplet 默认值 |
103+ | --------- | ---------------------------- | ---------------------------- |
104+ | x86 | i686-linux-gnu | 尚未就绪
105+ | x64 | x86_64-linux-gnu | 尚未就绪
106+ | ARM | arm-linux-gnueabihf | 尚未就绪
107+ | ARM64 | aarch64-linux-gnu | 尚未就绪
108+ | MIPS | mips-linux-gnu | 不支持
109+
110+ 示例:
111+ ``` xml
112+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Debug|x86'" Label =" Configuration" >
113+ <PlatformTriplet >i686-linux-gnu</PlatformTriplet >
114+ </PropertyGroup >
115+ ```
116+
117+ ### 2.4.4. Sysroot 全局属性
118+ 用于自定义库目录以及头文件位置。此路径会通过` --sysroot ` 传递给编译器以及链接器。
119+
78120
79121# 3. 支持的属性以及元素参数映射情况
122+
80123## 3.1. ClCompile
81124它描述了C/C++代码编译参数配置情况。
82125
@@ -519,20 +562,6 @@ ObjCAutomaticRefCounting开启时发生异常保证不泄露内存。
519562</ClCompile >
520563```
521564
522- ### 3.1.31. Sysroot 属性(字符串)
523- 设置库和头文件的根目录,一般交叉编译时需要。
524-
525- | Windows(MSVC) | Linux(GCC/CLang) | OSX(GCC/CLang)
526- | ----------------- | ----------------- | --------
527- | 自动忽略 | --sysroot | --sysroot
528-
529- 示例:
530- ``` xml
531- <ClCompile >
532- <Sysroot >Usr/aarch64-linux-gnu</Sysroot >
533- </ClCompile >
534- ```
535-
536565## 3.2. Link
537566链接配置。
538567
@@ -812,20 +841,6 @@ Apple特有的Framework引用(-framework)。
812841</Link >
813842```
814843
815- ### 3.1.22. Sysroot 属性(字符串)
816- 设置库和头文件的根目录,一般交叉编译时需要。
817-
818- | Windows(MSVC) | Linux(GCC/CLang) | OSX(GCC/CLang)
819- | ----------------- | ----------------- | --------
820- | 自动忽略 | --sysroot | --sysroot
821-
822- 示例:
823- ``` xml
824- <Link >
825- <Sysroot >Usr/aarch64-linux-gnu</Sysroot >
826- </Link >
827- ```
828-
829844# 附: 我怎么自己编译 MSBuildCppCrossToolset?
830845> 温馨提示:普通用户无需关心如何编译 MSBuildCppCrossToolset。只需要从Release产物中下载即可。
831846
0 commit comments