瀏覽代碼

update docs for 2.3.8

ruki 5 年之前
父節點
當前提交
bbd2fb745f

+ 77 - 6
guide/configuration.md

@@ -44,10 +44,8 @@ $ xmake f -p android --ndk=~/files/android-ndk-r10e/ -a arm64-v8a --bin=~/files/
 ```
 
 The [--bin](#-bin) option is used to set `bin` directory of toolchains.
-    
-<p class="tip">
-Please attempt to set `--arch=` option if it had failed to check compiler.
-</p>
+
+!> Please attempt to set `--arch=` option if it had failed to check compiler.
 
 ### iPhoneOS
 
@@ -65,10 +63,37 @@ $ xmake
 
 ### Mingw
 
+In addition to supporting Msys2/MingW, MingW for macOS/linux, xmake also supports the llvm-mingw tool chain, which can switch the arm/arm64 architecture to compile.
+
+```bash
+$ xmake f -p mingw --sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64|arm|arm64]
+$ xmake
+```
+
+### Wasm (WebAssembly)
+
+This platform is used to compile WebAssembly programs (emcc toolchain is used internally). Before switching this platform, we need to enter the Emscripten toolchain environment to ensure that emcc and other compilers are available.
+
 ```bash
-$ xmake f -p mingw --sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64]
+$ xmake f -p wasm
 $ xmake
-``` 
+```
+
+xmake also supports Qt for wasm compilation, you only need:
+
+```bash
+$ xmake f -p wasm [--qt=~/Qt]
+$ xmake
+```
+
+The `--qt` parameter setting is optional, usually xmake can detect the sdk path of qt.
+
+
+One thing to note is that there is a correspondence between the versions of Emscripten and Qt SDK. If the version does not match, there may be compatibility issues between Qt/Wasm.
+
+Regarding the version correspondence, you can see: [https://wiki.qt.io/Qt_for_WebAssembly](https://wiki.qt.io/Qt_for_WebAssembly)
+
+For more details, please see: [https://github.com/xmake-io/xmake/issues/956](https://github.com/xmake-io/xmake/issues/956)
 
 ### Apple WatchOS
 
@@ -468,6 +493,13 @@ After setting the `--mingw` root directory to the global configuration through t
 
 In addition, the usage of other tool chain configuration parameters is the same as that described above. For example, `--cross`,` --bin=`, etc. can be adjusted according to the actual needs of the environment. Own mingw tool chain.
 
+xmake also supports the llvm-mingw tool chain, which can be switched to arm/arm64 architecture to compile.
+
+```bash
+$ xmake f --mingw=/xxx/llvm-mingw -a arm64
+$ xmake
+```
+
 #### LLVM Toolchain
 
 The tool chain of llvm is relatively standard, only need to set the sdk configuration path to use:
@@ -486,6 +518,45 @@ $ xmake f -p cross --toolchain=gnu-rm --sdk=/xxx/cc-arm-none-eabi-9-2019-q4-majo
 $ xmake
 ```
 
+#### TinyC Toolchain
+
+```bash
+$ xmake f --toolchain=tinyc
+$ xmake
+```
+
+!> In the Releases directory, we also provide a special xmake-tinyc-vX.X.X.win32.exe installation package, built-in tinyc tool chain, without relying on msvc, you can also compile c code, out of the box use without dependencies.
+
+#### Emcc tool chain
+
+Usually only need to switch to the Wasm platform, which has built-in emcc toolchain, and additionally adjusts the extension of the target program to `*.html` and output `*.wasm`.
+
+```bash
+$ xmake f -p wasm
+$ xmake
+```
+
+However, we can also switch directly to the emcc toolchain, but the suffix name will not be modified.
+
+```bash
+$ xmake f --toolchain=emcc
+$ xmake
+```
+
+#### Intel C++ Compiler Tool Chain
+
+```bash
+$ xmake f --toolchain=icc
+$ xmake
+```
+
+#### Intel Fortran Compilation Tool Chain
+
+```bash
+$ xmake f --toolchain=ifort
+$ xmake
+```
+
 ### Common Cross-compilation configuration
 
 | Configuration Option         | Description                                  |

+ 41 - 35
guide/project_examples.md

@@ -95,14 +95,17 @@ xmake will detect Qt SDK automatically and we can also set the SDK directory man
 $ xmake f --qt=~/Qt/Qt5.9.1
 ```
 
-If you want to use the MinGW Qt environment on windows, you can set the MinGW platform configuration and specify the SDK path for the MinGW compilation environment, for example:
+The MingW SDK specified above uses the environment that comes with the Tools directory under Qt. Of course, if there are other third-party MingW compilation environments, they can also be specified manually. 
+For details, please refer to: [MingW Configuration](/guide/configuration?id=mingw).
+
+For more details, please refer to: [#160](https://github.com/xmake-io/xmake/issues/160)
+
+In addition, currently xmake also supports Qt/Wasm. For details, see: [Wasm Configuration](/guide/configuration?id=wasm)
 
 ```console
-$ xmake f -p mingw --sdk=C:\Qt\Qt5.10.1\Tools\mingw530_32 
+$ xmake f -p wasm
 ```
 
-If you want to known more information, you can see [#160](https://github.com/xmake-io/xmake/issues/160).
-
 ### Static Library
 
 ```lua
@@ -140,17 +143,7 @@ target("qt_quickapp")
     add_files("src/qml.qrc")
 ```
 
-!> The new version provides the `qt.quickapp` rule, built-in QtQuick built-in rules, the use of simpler, the following version of the `qt.application` is still supported, backward compatible:
-
-```lua
-target("qt_quickapp")
-    add_rules("qt.application")
-    add_files("src/*.cpp") 
-    add_files("src/qml.qrc")
-    add_frameworks("QtQuick")
-```
-
-!> If you are using your own compiled static version of the QT SDK, you need to switch to the `add_rules("qt.quickapp_static")` static rule, 
+!> If you are using your own compiled static version of the QT SDK, you need to switch to the `add_rules("qt.quickapp_static")` static rule,
 because the linked libraries are different and need to be statically linked.
 
 Next, we try to compile, usually, if you use the Qt installation package to install by default, and do not modify the installation path, then in most cases you can automatically detect the root path of the QT SDK, for example:
@@ -195,13 +188,13 @@ target("qt_widgetapp")
 ```lua
 target("qt_widgetapp")
     add_rules("qt.application")
-    add_files("src/*.cpp") 
+    add_files("src/*.cpp")
     add_files("src/mainwindow.ui")
     add_files("src/mainwindow.h")  -- add files with Q_OBJECT meta (only for qt.moc)
     add_frameworks("QtWidgets")
 ```
 
-!> If you are using your own compiled static version of the QT SDK, you need to switch to the `add_rules("qt.widgetapp_static")` static rule, 
+!> If you are using your own compiled static version of the QT SDK, you need to switch to the `add_rules("qt.widgetapp_static")` static rule,
 because the linked libraries are different and need to be statically linked.
 
 The effect is as follows:
@@ -251,13 +244,13 @@ And see [WDK examples](https://github.com/xmake-io/xmake/tree/master/tests/proje
 ```lua
 target("echo")
     add_rules("wdk.driver", "wdk.env.umdf")
-    add_files("driver/*.c") 
+    add_files("driver/*.c")
     add_files("driver/*.inx")
     add_includedirs("exe")
 
 target("app")
     add_rules("wdk.binary", "wdk.env.umdf")
-    add_files("exe/*.cpp") 
+    add_files("exe/*.cpp")
 ```
 
 ### KMDF Driver Program
@@ -266,12 +259,12 @@ target("app")
 target("nonpnp")
     add_rules("wdk.driver", "wdk.env.kmdf")
     add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
-    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.c", {rule = "wdk.tracewpp"})
     add_files("driver/*.rc")
 
 target("app")
     add_rules("wdk.binary", "wdk.env.kmdf")
-    add_files("exe/*.c") 
+    add_files("exe/*.c")
     add_files("exe/*.inf")
 ```
 
@@ -284,20 +277,20 @@ target("kcs")
     add_values("wdk.man.resource", "kcsCounters.rc")
     add_values("wdk.man.header", "kcsCounters.h")
     add_values("wdk.man.counter_header", "kcsCounters_counters.h")
-    add_files("*.c", "*.rc", "*.man") 
+    add_files("*.c", "*.rc", "*.man")
 ```
 
 ```lua
 target("msdsm")
     add_rules("wdk.driver", "wdk.env.wdm")
     add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
-    add_files("*.c", {rule = "wdk.tracewpp"}) 
+    add_files("*.c", {rule = "wdk.tracewpp"})
     add_files("*.rc", "*.inf")
     add_files("*.mof|msdsm.mof")
-    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}}) 
+    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}})
 ```
 
-### Package Driver 
+### Package Driver
 
 We can run the following command to generate a .cab driver package.
 
@@ -319,7 +312,7 @@ The output files like:
 
 ### Driver Signing
 
-The driver signing is disabled when we compile driver in default case, 
+The driver signing is disabled when we compile driver in default case,
 but we can add `set_values("wdk.sign.mode")` to enable test/release sign.
 
 #### TestSign
@@ -497,12 +490,12 @@ How do we know the signature configuration we need? One is to view it in xcode.
 ```console
 $ xmake l private.tools.codesign.dump
 ==================================== codesign identities ====================================
-{ 
-  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1" 
+{
+  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1"
 }
 
 ===================================== mobile provisions =====================================
-{ 
+{
   "iOS Team Provisioning Profile: org.tboox.test" = "<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
@@ -543,7 +536,7 @@ The effect is as follows:
 
 #### Package program
 
-If it is an iOS program, it will generate an ipa installation package, if it is macos, it will generate a dmg package (dmg package generation is still under development for the time being).
+If it is an iOS program, it will generate an ipa installation package, if it is macOS, it will generate a dmg package (dmg package generation is still under development for the time being).
 
 ```console
 $ xmake package
@@ -661,21 +654,19 @@ target("cuda_console")
     add_cugencodes("compute_30")
 ```
 
-<p class="tip">
-Starting with v2.2.7, the default build will enable device-link. (see [Separate Compilation and Linking of CUDA C++ Device Code](https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/))
+!> Starting with v2.2.7, the default build will enable device-link. (see [Separate Compilation and Linking of CUDA C++ Device Code](https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/))
 If you want to disable device-link, you can set it with `add_values("cuda.devlink", false)`.
-</p>
 
 xmake will detect Cuda SDK automatically and we can also set the SDK directory manually.
 
 ```console
-$ xmake f --cuda=/usr/local/cuda-9.1/ 
+$ xmake f --cuda=/usr/local/cuda-9.1/
 $ xmake
 ```
 
 If you want to known more information, you can see [#158](https://github.com/xmake-io/xmake/issues/158).
 
-## Lex&Yacc Program
+## Lex & Yacc Program
 
 ```lua
 target("calc")
@@ -684,10 +675,25 @@ target("calc")
      add_files("src/*.l", "src/*.y")
 ```
 
+## OpenMP Program
+
+```lua
+add_requires("libomp", {optional = true})
+target("loop")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    add_rules("c++.openmp")
+    add_packages("libomp")
+```
+
+If it is c code, you need to enable ʻadd_rules("c.openmp")`. If it is c/c++ mixed compilation, then these two rules must be set.
+
 ## Fortran Program
 
 After v2.3.6, the gfortran compiler is supported to compile fortran projects. We can quickly create an empty project based on fortran by using the following command:
 
+After v2.3.8, xmake also supports Intel Fortran Compiler, you only need to switch the toolchain: `xmake f --toolchain=ifort`
+
 ```console
 $ xmake create -l fortran -t console test
 ```

+ 59 - 36
manual/project_target.md

@@ -37,6 +37,7 @@ target("test2")
 | [set_warnings](#targetset_warnings)             | Set compilation warning level                             | >= 1.0.1                    |
 | [set_optimize](#targetset_optimize)             | Set compilation optimization level                        | >= 1.0.1                    |
 | [set_languages](#targetset_languages)           | Set source code language standards                        | >= 1.0.1                    |
+| [set_fpmodels](#targetset_fpmodels)             | Set float-point compilation model                         | >= 2.3.8                    |
 | [set_targetdir](#targetset_targetdir)           | Set output directories for target file                    | >= 1.0.1                    |
 | [set_objectdir](#targetset_objectdir)           | Set output directories for object files                   | >= 1.0.1                    |
 | [set_dependir](#targetset_dependir)             | Set output directories for dependent files                | >= 2.2.2                    |
@@ -488,23 +489,28 @@ Set the language standard for target code compilation. If no target exists, it w
 
 The supported language standards currently have the following main ones:
 
-| Value | Description |
-| ---------- | ---------------------- |
-| ansi | c language standard: ansi |
-| c89 | c language standard: c89 |
-| gnu89 | c language standard: gnu89 |
-| c99 | c language standard: c99 |
-| gnu99 | c language standard: gnu99 |
-| cxx98 | c++ language standard: `c++98` |
-| gnuxx98 | c++ language standard: `gnu++98` |
-| cxx11 | c++ language standard: `c++11` |
-| gnuxx11 | c++ language standard: `gnu++11` |
-| cxx14 | c++ language standard: `c++14` |
-| gnuxx14 | c++ language standard: `gnu++14` |
-| cxx1z | c++ language standard: `c++1z` |
-| gnuxx1z | c++ language standard: `gnu++1z` |
-| cxx17 | c++ language standard: `c++17` |
-| gnuxx17 | c++ language standard: `gnu++17` |
+| Value      | Description                      |
+| ---------- | ----------------------           |
+| ansi       | c language standard: ansi        |
+| c89        | c language standard: c89         |
+| gnu89      | c language standard: gnu89       |
+| c99        | c language standard: c99         |
+| gnu99      | c language standard: gnu99       |
+| c11        | c language standard: c11         |
+| c17        | c language standard: c17         |
+
+| Value      | Description                      |
+| ---------- | ----------------------           |
+| cxx98      | c++ language standard: `c++98`   |
+| gnuxx98    | c++ language standard: `gnu++98` |
+| cxx11      | c++ language standard: `c++11`   |
+| gnuxx11    | c++ language standard: `gnu++11` |
+| cxx14      | c++ language standard: `c++14`   |
+| gnuxx14    | c++ language standard: `gnu++14` |
+| cxx1z      | c++ language standard: `c++1z`   |
+| gnuxx1z    | c++ language standard: `gnu++1z` |
+| cxx17      | c++ language standard: `c++17`   |
+| gnuxx17    | c++ language standard: `gnu++17` |
 
 The c standard and the c++ standard can be set at the same time, for example:
 
@@ -513,14 +519,31 @@ The c standard and the c++ standard can be set at the same time, for example:
 set_languages("c99", "cxx11")
 ```
 
-<p class="warn">
-Instead of setting the specified standard, the compiler will compile according to this standard. After all, each compiler supports different strengths, but xmake will try to adapt the support standard of the current compiler tool to the greatest extent possible. . .
-<br><br>
-E.g:
-<br>
-Windows vs compiler does not support compiling c code according to c99 standard, can only support c89, but xmake in order to support it as much as possible, so after setting c99 standard, xmake will force to compile according to c++ code mode c code, to some extent solved the c code problem of compiling c99 under windows. .
-Users do not need to make any additional modifications. .
-</p>
+It is not that a specified standard is set, and the compiler will compile according to this standard. After all, each compiler supports different strengths, but xmake will try its best to adapt to the support standards of the current compilation tool.
+
+The msvc compiler does not support compiling c code according to the c99 standard, and can only support c89, but xmake supports it as much as possible, so after setting the c99 standard, xmake will force the c++ code mode to compile c code , To a certain extent, it solves the problem of compiling c99 c code under windows. .
+The user does not need to make any additional changes.
+
+However, the latest msvc compilation already supports the c11/c17 standard, and xmake will not do additional special processing.
+
+### target:set_fpmodels
+
+#### Set float-point compilation mode
+
+This interface is used to set the floating-point compilation mode and the compilation abstract settings for mathematical calculation related optimizations. It provides several commonly used levels such as fast, strict, except, precise, etc. Some of them can be set at the same time, and some are conflicting. Effective.
+
+For the description of these levels, you can refer to the Microsoft document: [Specify floating-point behavior](https://docs.microsoft.com/en-us/cpp/build/reference/fp-specify-floating-point-behavior ?view=vs-2019)
+
+Of course, for other compilers such as gcc/icc, xmake will map to different compilation flags.
+
+```lua
+set_fpmodels("fast")
+set_fpmodels("strict")
+set_fpmodels("fast", "except")
+set_fpmodels("precise") - default
+```
+
+For details about this, see: [https://github.com/xmake-io/xmake/issues/981](https://github.com/xmake-io/xmake/issues/981)
 
 ### target:set_targetdir
 
@@ -666,7 +689,7 @@ This is a new interface after v2.2.7, which is used to customize the link proces
 
 ```lua
 target("test")
-    on_link(function (target) 
+    on_link(function (target)
         print("link it")
     end)
 ```
@@ -882,7 +905,7 @@ This is a new interface after v2.2.7 to add custom script before linking target.
 
 ```lua
 target("test")
-    before_link(function (target) 
+    before_link(function (target)
         print("")
     end)
 ```
@@ -1002,7 +1025,7 @@ This is a new interface after v2.2.7 to add custom script after linking target.
 
 ```lua
 target("test")
-    after_link(function (target) 
+    after_link(function (target)
         print("")
     end)
 ```
@@ -2398,22 +2421,22 @@ If you want to get a list and description of all the policy configurations suppo
 
 ```bash
 $ xmake l core.project.policy.policies
-{ 
-  "check.auto_map_flags" = { 
+{
+  "check.auto_map_flags" = {
     type = "boolean",
     description = "Enable map gcc flags to the current compiler and linker automatically.",
-    default = true 
+    default = true
   },
-  "build.across_targets_in_parallel" = { 
+  "build.across_targets_in_parallel" = {
     type = "boolean",
     description = "Enable compile the source files for each target in parallel.",
-    default = true 
+    default = true
   },
-  "check.auto_ignore_flags" = { 
+  "check.auto_ignore_flags" = {
     type = "boolean",
     description = "Enable check and ignore unsupported flags automatically.",
-    default = true 
-  } 
+    default = true
+  }
 }
 ```
 

+ 42 - 4
mirror/guide/configuration.html

@@ -115,9 +115,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p android --ndk=~/files/android-ndk-r10e/ -a arm64-v8a --bin=~/files/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin
 </code></pre>
 <p>The <a href="#-bin">--bin</a> option is used to set <code>bin</code> directory of toolchains.</p>
-<p><p class="tip"><br>Please attempt to set <code>--arch=</code> option if it had failed to check compiler.<br></p>
-
-</p>
+<p>!> Please attempt to set <code>--arch=</code> option if it had failed to check compiler.</p>
 <h3 id="iphoneos">iPhoneOS</h3>
 <pre><code class="lang-bash">$ xmake f -p iphoneos [-a armv7|armv7s|arm64|i386|x86_64]
 $ xmake
@@ -127,9 +125,23 @@ $ xmake
 $ xmake
 </code></pre>
 <h3 id="mingw">Mingw</h3>
-<pre><code class="lang-bash">$ xmake f -p mingw --sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64]
+<p>In addition to supporting Msys2/MingW, MingW for macOS/linux, xmake also supports the llvm-mingw tool chain, which can switch the arm/arm64 architecture to compile.</p>
+<pre><code class="lang-bash">$ xmake f -p mingw --sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64|arm|arm64]
 $ xmake
 </code></pre>
+<h3 id="wasmwebassembly">Wasm (WebAssembly)</h3>
+<p>This platform is used to compile WebAssembly programs (emcc toolchain is used internally). Before switching this platform, we need to enter the Emscripten toolchain environment to ensure that emcc and other compilers are available.</p>
+<pre><code class="lang-bash">$ xmake f -p wasm
+$ xmake
+</code></pre>
+<p>xmake also supports Qt for wasm compilation, you only need:</p>
+<pre><code class="lang-bash">$ xmake f -p wasm [--qt=~/Qt]
+$ xmake
+</code></pre>
+<p>The <code>--qt</code> parameter setting is optional, usually xmake can detect the sdk path of qt.</p>
+<p>One thing to note is that there is a correspondence between the versions of Emscripten and Qt SDK. If the version does not match, there may be compatibility issues between Qt/Wasm.</p>
+<p>Regarding the version correspondence, you can see: <a href="https://wiki.qt.io/Qt_for_WebAssembly">https://wiki.qt.io/Qt_for_WebAssembly</a></p>
+<p>For more details, please see: <a href="https://github.com/xmake-io/xmake/issues/956">https://github.com/xmake-io/xmake/issues/956</a></p>
 <h3 id="applewatchos">Apple WatchOS</h3>
 <pre><code class="lang-bash">$ xmake f -p watchos [-a i386|armv7k]
 $ xmake
@@ -385,6 +397,10 @@ $ xmake
 </code></pre>
 <p>After setting the <code>--mingw</code> root directory to the global configuration through the<code>xmake g/global</code> command, after each compilation and switching of the compilation platform, there is no need to specify an additional mingw toolchain path, which is convenient for use.</p>
 <p>In addition, the usage of other tool chain configuration parameters is the same as that described above. For example, <code>--cross</code>,<code>--bin=</code>, etc. can be adjusted according to the actual needs of the environment. Own mingw tool chain.</p>
+<p>xmake also supports the llvm-mingw tool chain, which can be switched to arm/arm64 architecture to compile.</p>
+<pre><code class="lang-bash">$ xmake f --mingw=/xxx/llvm-mingw -a arm64
+$ xmake
+</code></pre>
 <h4 id="llvmtoolchain">LLVM Toolchain</h4>
 <p>The tool chain of llvm is relatively standard, only need to set the sdk configuration path to use:</p>
 <pre><code class="lang-bash">$ xmake f -p cross --toolchain=llvm --sdk="C:\Program Files\LLVM"
@@ -395,6 +411,28 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p cross --toolchain=gnu-rm --sdk=/xxx/cc-arm-none-eabi-9-2019-q4-major
 $ xmake
 </code></pre>
+<h4 id="tinyctoolchain">TinyC Toolchain</h4>
+<pre><code class="lang-bash">$ xmake f --toolchain=tinyc
+$ xmake
+</code></pre>
+<p>!> In the Releases directory, we also provide a special xmake-tinyc-vX.X.X.win32.exe installation package, built-in tinyc tool chain, without relying on msvc, you can also compile c code, out of the box use without dependencies.</p>
+<h4 id="emcctoolchain">Emcc tool chain</h4>
+<p>Usually only need to switch to the Wasm platform, which has built-in emcc toolchain, and additionally adjusts the extension of the target program to <code>*.html</code> and output <code>*.wasm</code>.</p>
+<pre><code class="lang-bash">$ xmake f -p wasm
+$ xmake
+</code></pre>
+<p>However, we can also switch directly to the emcc toolchain, but the suffix name will not be modified.</p>
+<pre><code class="lang-bash">$ xmake f --toolchain=emcc
+$ xmake
+</code></pre>
+<h4 id="intelccompilertoolchain">Intel C++ Compiler Tool Chain</h4>
+<pre><code class="lang-bash">$ xmake f --toolchain=icc
+$ xmake
+</code></pre>
+<h4 id="intelfortrancompilationtoolchain">Intel Fortran Compilation Tool Chain</h4>
+<pre><code class="lang-bash">$ xmake f --toolchain=ifort
+$ xmake
+</code></pre>
 <h3 id="commoncrosscompilationconfiguration">Common Cross-compilation configuration</h3>
 <table>
 <thead>

+ 29 - 27
mirror/guide/project_examples.html

@@ -149,10 +149,11 @@ $ xmake create -l c++ -t quickapp_qt test
 <p>xmake will detect Qt SDK automatically and we can also set the SDK directory manually.</p>
 <pre><code class="lang-console">$ xmake f --qt=~/Qt/Qt5.9.1
 </code></pre>
-<p>If you want to use the MinGW Qt environment on windows, you can set the MinGW platform configuration and specify the SDK path for the MinGW compilation environment, for example:</p>
-<pre><code class="lang-console">$ xmake f -p mingw --sdk=C:\Qt\Qt5.10.1\Tools\mingw530_32 
+<p>The MingW SDK specified above uses the environment that comes with the Tools directory under Qt. Of course, if there are other third-party MingW compilation environments, they can also be specified manually.<br>For details, please refer to: <a href="/mirror/guide/configuration.html#mingw">MingW Configuration</a>.</p>
+<p>For more details, please refer to: <a href="https://github.com/xmake-io/xmake/issues/160">#160</a></p>
+<p>In addition, currently xmake also supports Qt/Wasm. For details, see: <a href="/mirror/guide/configuration.html#wasm">Wasm Configuration</a></p>
+<pre><code class="lang-console">$ xmake f -p wasm
 </code></pre>
-<p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/160">#160</a>.</p>
 <h3 id="staticlibrary">Static Library</h3>
 <pre><code class="lang-lua">target("qt_static_library")
     add_rules("qt.static")
@@ -177,13 +178,6 @@ $ xmake create -l c++ -t quickapp_qt test
     add_files("src/*.cpp")
     add_files("src/qml.qrc")
 </code></pre>
-<p>!> The new version provides the <code>qt.quickapp</code> rule, built-in QtQuick built-in rules, the use of simpler, the following version of the <code>qt.application</code> is still supported, backward compatible:</p>
-<pre><code class="lang-lua">target("qt_quickapp")
-    add_rules("qt.application")
-    add_files("src/*.cpp") 
-    add_files("src/qml.qrc")
-    add_frameworks("QtQuick")
-</code></pre>
 <p>!> If you are using your own compiled static version of the QT SDK, you need to switch to the <code>add_rules("qt.quickapp_static")</code> static rule,<br>because the linked libraries are different and need to be statically linked.</p>
 <p>Next, we try to compile, usually, if you use the Qt installation package to install by default, and do not modify the installation path, then in most cases you can automatically detect the root path of the QT SDK, for example:</p>
 <pre><code class="lang-bash">$ xmake
@@ -213,7 +207,7 @@ Build ok!
 <p>!> The new version provides the <code>qt.widgetapp</code> rule, built-in QtWidgets built-in rules, the use of simpler, the following version of the <code>qt.application</code> is still supported, backward compatible:</p>
 <pre><code class="lang-lua">target("qt_widgetapp")
     add_rules("qt.application")
-    add_files("src/*.cpp") 
+    add_files("src/*.cpp")
     add_files("src/mainwindow.ui")
     add_files("src/mainwindow.h")  -- add files with Q_OBJECT meta (only for qt.moc)
     add_frameworks("QtWidgets")
@@ -249,24 +243,24 @@ $ xmake
 <h3 id="umdfdriverprogram">UMDF Driver Program</h3>
 <pre><code class="lang-lua">target("echo")
     add_rules("wdk.driver", "wdk.env.umdf")
-    add_files("driver/*.c") 
+    add_files("driver/*.c")
     add_files("driver/*.inx")
     add_includedirs("exe")
 
 target("app")
     add_rules("wdk.binary", "wdk.env.umdf")
-    add_files("exe/*.cpp") 
+    add_files("exe/*.cpp")
 </code></pre>
 <h3 id="kmdfdriverprogram">KMDF Driver Program</h3>
 <pre><code class="lang-lua">target("nonpnp")
     add_rules("wdk.driver", "wdk.env.kmdf")
     add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
-    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.c", {rule = "wdk.tracewpp"})
     add_files("driver/*.rc")
 
 target("app")
     add_rules("wdk.binary", "wdk.env.kmdf")
-    add_files("exe/*.c") 
+    add_files("exe/*.c")
     add_files("exe/*.inf")
 </code></pre>
 <h3 id="wdmdriverprogram">WDM Driver Program</h3>
@@ -276,15 +270,15 @@ target("app")
     add_values("wdk.man.resource", "kcsCounters.rc")
     add_values("wdk.man.header", "kcsCounters.h")
     add_values("wdk.man.counter_header", "kcsCounters_counters.h")
-    add_files("*.c", "*.rc", "*.man") 
+    add_files("*.c", "*.rc", "*.man")
 </code></pre>
 <pre><code class="lang-lua">target("msdsm")
     add_rules("wdk.driver", "wdk.env.wdm")
     add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
-    add_files("*.c", {rule = "wdk.tracewpp"}) 
+    add_files("*.c", {rule = "wdk.tracewpp"})
     add_files("*.rc", "*.inf")
     add_files("*.mof|msdsm.mof")
-    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}}) 
+    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}})
 </code></pre>
 <h3 id="packagedriver">Package Driver</h3>
 <p>We can run the following command to generate a .cab driver package.</p>
@@ -416,12 +410,12 @@ $ xmake
 <p>How do we know the signature configuration we need? One is to view it in xcode. In addition, xmake also provides some auxiliary tools to dump all currently available signature configurations:</p>
 <pre><code class="lang-console">$ xmake l private.tools.codesign.dump
 ==================================== codesign identities ====================================
-{ 
-  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1" 
+{
+  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1"
 }
 
 ===================================== mobile provisions =====================================
-{ 
+{
   "iOS Team Provisioning Profile: org.tboox.test" = "<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
@@ -448,7 +442,7 @@ $ xmake run</code> `</p>
 <p>The effect is as follows:</p>
 <p><img src="/assets/img/guide/macapp.png" alt=""></p>
 <h4 id="packageprogram">Package program</h4>
-<p>If it is an iOS program, it will generate an ipa installation package, if it is macos, it will generate a dmg package (dmg package generation is still under development for the time being).</p>
+<p>If it is an iOS program, it will generate an ipa installation package, if it is macOS, it will generate a dmg package (dmg package generation is still under development for the time being).</p>
 <pre><code class="lang-console">$ xmake package
 output: build/iphoneos/release/arm64/test.ipa
 package ok!
@@ -524,22 +518,30 @@ target("cuda_console")
     -- generate PTX code for the virtual architecture to guarantee compatibility
     add_cugencodes("compute_30")
 </code></pre>
-<p><p class="tip"><br>Starting with v2.2.7, the default build will enable device-link. (see <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>If you want to disable device-link, you can set it with <code>add_values("cuda.devlink", false)</code>.<br></p>
-
-</p>
+<p>!> Starting with v2.2.7, the default build will enable device-link. (see <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>If you want to disable device-link, you can set it with <code>add_values("cuda.devlink", false)</code>.</p>
 <p>xmake will detect Cuda SDK automatically and we can also set the SDK directory manually.</p>
-<pre><code class="lang-console">$ xmake f --cuda=/usr/local/cuda-9.1/ 
+<pre><code class="lang-console">$ xmake f --cuda=/usr/local/cuda-9.1/
 $ xmake
 </code></pre>
 <p>If you want to known more information, you can see <a href="https://github.com/xmake-io/xmake/issues/158">#158</a>.</p>
-<h2 id="lexyaccprogram">Lex&amp;Yacc Program</h2>
+<h2 id="lexyaccprogram">Lex &amp; Yacc Program</h2>
 <pre><code class="lang-lua">target("calc")
      set_kind("binary")
      add_rules("lex", "yacc")
      add_files("src/*.l", "src/*.y")
 </code></pre>
+<h2 id="openmpprogram">OpenMP Program</h2>
+<pre><code class="lang-lua">add_requires("libomp", {optional = true})
+target("loop")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    add_rules("c++.openmp")
+    add_packages("libomp")
+</code></pre>
+<p>If it is c code, you need to enable ʻadd_rules("c.openmp")`. If it is c/c++ mixed compilation, then these two rules must be set.</p>
 <h2 id="fortranprogram">Fortran Program</h2>
 <p>After v2.3.6, the gfortran compiler is supported to compile fortran projects. We can quickly create an empty project based on fortran by using the following command:</p>
+<p>After v2.3.8, xmake also supports Intel Fortran Compiler, you only need to switch the toolchain: <code>xmake f --toolchain=ifort</code></p>
 <pre><code class="lang-console">$ xmake create -l fortran -t console test
 </code></pre>
 <p>Its xmake.lua content is as follows:</p>

+ 48 - 14
mirror/manual/project_target.html

@@ -182,6 +182,11 @@ target("test2")
 <td>>= 1.0.1</td>
 </tr>
 <tr>
+<td><a href="#targetset_fpmodels">set_fpmodels</a></td>
+<td>Set float-point compilation model</td>
+<td>>= 2.3.8</td>
+</tr>
+<tr>
 <td><a href="#targetset_targetdir">set_targetdir</a></td>
 <td>Set output directories for target file</td>
 <td>>= 1.0.1</td>
@@ -1028,6 +1033,24 @@ set_optimize("fastest")
 <td>c language standard: gnu99</td>
 </tr>
 <tr>
+<td>c11</td>
+<td>c language standard: c11</td>
+</tr>
+<tr>
+<td>c17</td>
+<td>c language standard: c17</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>Value</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
 <td>cxx98</td>
 <td>c++ language standard: <code>c++98</code></td>
 </tr>
@@ -1073,9 +1096,20 @@ set_optimize("fastest")
 <pre><code class="lang-lua">-- Set c code standard: c99, c++ code standard: c++11
 set_languages("c99", "cxx11")
 </code></pre>
-<p><p class="warn"><br>Instead of setting the specified standard, the compiler will compile according to this standard. After all, each compiler supports different strengths, but xmake will try to adapt the support standard of the current compiler tool to the greatest extent possible. . .<br><br><br><br>E.g:<br><br><br>Windows vs compiler does not support compiling c code according to c99 standard, can only support c89, but xmake in order to support it as much as possible, so after setting c99 standard, xmake will force to compile according to c++ code mode c code, to some extent solved the c code problem of compiling c99 under windows. .<br>Users do not need to make any additional modifications. .<br></p>
-
-</p>
+<p>It is not that a specified standard is set, and the compiler will compile according to this standard. After all, each compiler supports different strengths, but xmake will try its best to adapt to the support standards of the current compilation tool.</p>
+<p>The msvc compiler does not support compiling c code according to the c99 standard, and can only support c89, but xmake supports it as much as possible, so after setting the c99 standard, xmake will force the c++ code mode to compile c code , To a certain extent, it solves the problem of compiling c99 c code under windows. .<br>The user does not need to make any additional changes.</p>
+<p>However, the latest msvc compilation already supports the c11/c17 standard, and xmake will not do additional special processing.</p>
+<h3 id="targetset_fpmodels">target:set_fpmodels</h3>
+<h4 id="setfloatpointcompilationmode">Set float-point compilation mode</h4>
+<p>This interface is used to set the floating-point compilation mode and the compilation abstract settings for mathematical calculation related optimizations. It provides several commonly used levels such as fast, strict, except, precise, etc. Some of them can be set at the same time, and some are conflicting. Effective.</p>
+<p>For the description of these levels, you can refer to the Microsoft document: <a href="https://docs.microsoft.com/en-us/cpp/build/reference/fp-specify-floating-point-behavior ?view=vs-2019">Specify floating-point behavior</a></p>
+<p>Of course, for other compilers such as gcc/icc, xmake will map to different compilation flags.</p>
+<pre><code class="lang-lua">set_fpmodels("fast")
+set_fpmodels("strict")
+set_fpmodels("fast", "except")
+set_fpmodels("precise") - default
+</code></pre>
+<p>For details about this, see: <a href="https://github.com/xmake-io/xmake/issues/981">https://github.com/xmake-io/xmake/issues/981</a></p>
 <h3 id="targetset_targetdir">target:set_targetdir</h3>
 <h4 id="setoutputdirectoriesfortargetfiles">Set output directories for target files</h4>
 <p>Set the output directory of the target program file. Under normal circumstances, you do not need to set it. The default output will be in the build directory.</p>
@@ -1174,7 +1208,7 @@ target("test")
 <h4 id="runcustomlinktargetscript">Run custom link target script</h4>
 <p>This is a new interface after v2.2.7, which is used to customize the link process of the target.</p>
 <pre><code class="lang-lua">target("test")
-    on_link(function (target) 
+    on_link(function (target)
         print("link it")
     end)
 </code></pre>
@@ -1365,7 +1399,7 @@ target("demo")
 <h4 id="runcustomscriptbeforelinkingtarget">Run custom script before linking target</h4>
 <p>This is a new interface after v2.2.7 to add custom script before linking target.</p>
 <pre><code class="lang-lua">target("test")
-    before_link(function (target) 
+    before_link(function (target)
         print("")
     end)
 </code></pre>
@@ -1439,7 +1473,7 @@ target("demo")
 <h4 id="runcustomscriptafterlinkingtarget">Run custom script after linking target</h4>
 <p>This is a new interface after v2.2.7 to add custom script after linking target.</p>
 <pre><code class="lang-lua">target("test")
-    after_link(function (target) 
+    after_link(function (target)
         print("")
     end)
 </code></pre>
@@ -2470,22 +2504,22 @@ ${define FOO_STRING}
 </table>
 <p>If you want to get a list and description of all the policy configurations supported by the current xmake, you can execute the following command:</p>
 <pre><code class="lang-bash">$ xmake l core.project.policy.policies
-{ 
-  "check.auto_map_flags" = { 
+{
+  "check.auto_map_flags" = {
     type = "boolean",
     description = "Enable map gcc flags to the current compiler and linker automatically.",
-    default = true 
+    default = true
   },
-  "build.across_targets_in_parallel" = { 
+  "build.across_targets_in_parallel" = {
     type = "boolean",
     description = "Enable compile the source files for each target in parallel.",
-    default = true 
+    default = true
   },
-  "check.auto_ignore_flags" = { 
+  "check.auto_ignore_flags" = {
     type = "boolean",
     description = "Enable check and ignore unsupported flags automatically.",
-    default = true 
-  } 
+    default = true
+  }
 }
 </code></pre>
 <h5 id="checkauto_ignore_flags">check.auto_ignore_flags</h5>

+ 45 - 7
mirror/zh-cn/guide/configuration.html

@@ -113,9 +113,7 @@ $ xmake
 <pre><code class="lang-bash">$ xmake f -p android --ndk=~/files/android-ndk-r10e/ -a arm64-v8a --bin=~/files/android-ndk-r10e/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin
 </code></pre>
 <p><a href="#-bin">--bin</a>主要用于设置选择编译工具的具体bin目录,这个的使用跟<a href="#交叉编译">交叉编译</a>中的<a href="#-bin">--bin</a>的行为是一致的。</p>
-<p><p class="tip"><br>如果手动设置了bin目录,没有通过检测,可以看下是否<code>--arch=</code>参数没有匹配对。<br></p>
-
-</p>
+<p>!> 如果手动设置了bin目录,没有通过检测,可以看下是否<code>--arch=</code>参数没有匹配对。</p>
 <h3 id="iphoneos">iPhoneOS</h3>
 <pre><code class="lang-bash">$ xmake f -p iphoneos [-a armv7|armv7s|arm64|i386|x86_64]
 $ xmake
@@ -125,13 +123,27 @@ $ xmake
 $ xmake
 </code></pre>
 <h3 id="mingw">Mingw</h3>
-<pre><code class="lang-bash">$ xmake f -p mingw --sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64]
+<p>xmake 除了支持 Msys2/MingW, MingW for macOS/linux 之外,还支持 llvm-mingw 工具链,可以切换 arm/arm64 架构来编译。</p>
+<pre><code class="lang-bash">$ xmake f -p mingw --sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64|arm|arm64]
 $ xmake
 </code></pre>
 <h3 id="applewatchos">Apple WatchOS</h3>
 <pre><code class="lang-bash">$ xmake f -p watchos [-a i386|armv7k]
 $ xmake
 </code></pre>
+<h3 id="wasmwebassembly">Wasm (WebAssembly)</h3>
+<p>此平台用于编译 WebAssembly 程序(内部会使用emcc工具链),在切换此平台之前,我们需要先进入 Emscripten 工具链环境,确保 emcc 等编译器可用。</p>
+<pre><code class="lang-bash">$ xmake f -p wasm
+$ xmake
+</code></pre>
+<p>xmake 也支持 Qt for wasm 编译,只需要:</p>
+<pre><code class="lang-bash">$ xmake f -p wasm [--qt=~/Qt]
+$ xmake
+</code></pre>
+<p>其中 <code>--qt</code> 参数设置是可选的,通常xmake都能检测到qt的sdk路径。</p>
+<p>需要注意的一点是,Emscripten 和 Qt SDK 的版本是有对应关系的,不匹配的版本,可能会有Qt/Wasm之间的兼容问题。</p>
+<p>关于版本对应关系,可以看下:<a href="https://wiki.qt.io/Qt_for_WebAssembly">https://wiki.qt.io/Qt_for_WebAssembly</a></p>
+<p>更多详情见:<a href="https://github.com/xmake-io/xmake/issues/956">https://github.com/xmake-io/xmake/issues/956</a></p>
 <h2 id="">交叉编译配置</h2>
 <p>通常,如果我们需要在当前pc环境编译生成其他设备上才能运行的目标文件时候,就需要通过对应的交叉编译工具链来编译生成它们,比如在win/macos上编译linux的程序,或者在linux上编译其他嵌入式设备的目标文件等。</p>
 <p>通常的交叉编译工具链都是基于gcc/clang的,大都具有类似如下的结构:</p>
@@ -345,7 +357,7 @@ fasm          Flat Assembler
 </code></pre>
 <p>关于这块的详情介绍,可以到<a href="/mirror/zh-cn/manual/custom_toolchain.html">自定义工具链</a>章节查看</p>
 <p>更多详情见:<a href="https://github.com/xmake-io/xmake/issues/780">#780</a></p>
-<h4 id="mingw">MingW工具链</h4>
+<h4 id="mingw">MingW 工具链</h4>
 <p>使用mingw工具链编译,其实也是交叉编译,但是由于这个比较常用,xmake专门增加了一个mingw的平台来快速处理使用mingw工具链的编译。</p>
 <p>因此,xmake对mingw的工具链检测会更加完善,在macos下,基本上连sdk路径都不需要配置,也能直接检测到,只需要切到mingw平台编译即可。</p>
 <pre><code class="lang-bash">$ xmake f -p mingw
@@ -383,16 +395,42 @@ $ xmake
 </code></pre>
 <p>我们通过<code>xmake g/global</code>命令设置<code>--mingw</code>根目录到全局配置后,之后每次编译和切换编译平台,就不用额外指定mingw工具链路径了,方便使用。</p>
 <p>另外,其他的工具链配置参数用法,跟上文描述的没什么区别,像<code>--cross</code>, <code>--bin=</code>等都可以根据实际的环境需要,自己控制是否需要额外追加配置来适配自己的mingw工具链。</p>
-<h4 id="llvm">LLVM工具链</h4>
+<p>xmake 还支持 llvm-mingw 工具链,可以切换到 arm/arm64 架构来编译。</p>
+<pre><code class="lang-bash">$ xmake f --mingw=/xxx/llvm-mingw -a arm64
+$ xmake
+</code></pre>
+<h4 id="llvm">LLVM 工具链</h4>
 <p>llvm工具链下载地址:<a href="https://releases.llvm.org/">https://releases.llvm.org/</a></p>
 <pre><code class="lang-bash">$ xmake f -p cross --toolchain=llvm --sdk="C:\Program Files\LLVM"
 $ xmake
 </code></pre>
-<h4 id="gnurm">GNU-RM工具链</h4>
+<h4 id="gnurm">GNU-RM 工具链</h4>
 <p>工具链地址:<a href="https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads#">https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads#</a></p>
 <pre><code class="lang-bash">$ xmake f -p cross --toolchain=gnu-rm --sdk=/xxx/cc-arm-none-eabi-9-2019-q4-major
 $ xmake
 </code></pre>
+<h4 id="tinyc">TinyC 工具链</h4>
+<pre><code class="lang-bash">$ xmake f --toolchain=tinyc
+$ xmake
+</code></pre>
+<p>!> Releases目录下,我们还提供了特殊的 xmake-tinyc-vX.X.X.win32.exe 安装包,内置tinyc工具链,无需依赖msvc,也可以编译c代码,开箱即用无依赖。</p>
+<h4 id="emcc">Emcc 工具链</h4>
+<p>通常只需要切换到 Wasm 平台,里面内置了 emcc 工具链,还会额外调整目标程序的扩展名为 <code>*.html</code> 以及输出 <code>*.wasm</code>。</p>
+<pre><code class="lang-bash">$ xmake f -p wasm
+$ xmake
+</code></pre>
+<p>不过我们也能够直接切换到 emcc 工具链,但是后缀名不会被修改。</p>
+<pre><code class="lang-bash">$ xmake f --toolchain=emcc
+$ xmake
+</code></pre>
+<h4 id="intelc">Intel C++ 编译工具链</h4>
+<pre><code class="lang-bash">$ xmake f --toolchain=icc
+$ xmake
+</code></pre>
+<h4 id="intelfortran">Intel Fortran 编译工具链</h4>
+<pre><code class="lang-bash">$ xmake f --toolchain=ifort
+$ xmake
+</code></pre>
 <h3 id="">通用交叉编译配置</h3>
 <table>
 <thead>

+ 34 - 30
mirror/zh-cn/guide/project_examples.html

@@ -149,11 +149,14 @@ $ xmake create -l c++ -t quickapp_qt test
 <p>默认会自动探测Qt环境,当然也可以指定Qt SDK环境目录:</p>
 <pre><code class="lang-console">$ xmake f --qt=~/Qt/Qt5.9.1
 </code></pre>
-<p>如果想要使用windows下mingw的Qt环境,可以切到mingw的平台配置,并且指定下mingw编译环境的sdk路径即可,例如:</p>
-<pre><code class="lang-console">$ xmake f -p mingw --sdk=C:\Qt\Qt5.10.1\Tools\mingw530_32 
+<p>如果想要使用 windows 下 MingW 的 Qt 环境,可以切到mingw的平台配置,并且指定下mingw编译环境的sdk路径即可,例如:</p>
+<pre><code class="lang-console">$ xmake f -p mingw --sdk=C:\Qt\Qt5.10.1\Tools\mingw530_32
 </code></pre>
-<p>上述指定的mingw sdk用的是Qt下Tools目录自带的环境,当然如果有其他第三方mingw编译环境,也可以手动指定, 具体可以参考:<a href="#mingw">mingw编译配置</a>。</p>
+<p>上述指定的 MingW SDK 用的是Qt下Tools目录自带的环境,当然如果有其他第三方 MingW 编译环境,也可以手动指定, 具体可以参考:<a href="/mirror/zh-cn/guide/configuration.html#mingw">MingW 编译配置</a>。</p>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/160">#160</a></p>
+<p>另外,当前xmake也支持Qt/Wasm,详情见:<a href="/mirror/zh-cn/guide/configuration.html#wasm">Wasm 配置</a></p>
+<pre><code class="lang-console">$ xmake f -p wasm
+</code></pre>
 <h3 id="">静态库程序</h3>
 <pre><code class="lang-lua">target("qt_static_library")
     add_rules("qt.static")
@@ -175,15 +178,8 @@ $ xmake create -l c++ -t quickapp_qt test
 <p>v2.2.9以上版本:</p>
 <pre><code class="lang-lua">target("qt_quickapp")
     add_rules("qt.quickapp")
-    add_files("src/*.cpp") 
-    add_files("src/qml.qrc")
-</code></pre>
-<p>!> 新版本提供了<code>qt.quickapp</code>规则,内置了QtQuick的内建规则,使用更加简单,下面老版本的<code>qt.application</code>还是支持的,向下兼容:</p>
-<pre><code class="lang-lua">target("qt_quickapp")
-    add_rules("qt.application")
-    add_files("src/*.cpp") 
+    add_files("src/*.cpp")
     add_files("src/qml.qrc")
-    add_frameworks("QtQuick")
 </code></pre>
 <p>!> 如果使用的自己编译的static版本QT SDK,那么需要切换到<code>add_rules("qt.quickapp_static")</code>静态规则才行,因为链接的库是不同的,需要做静态链接。</p>
 <p>接下来,我们尝试编译下,通常,如果是使用Qt的安装包默认安装,也没有修改安装路径,那么大部分情况下都是可以自动检测到QT SDK的根路径,例如:</p>
@@ -207,14 +203,14 @@ build ok!
 <p>v2.2.9以上版本:</p>
 <pre><code class="lang-lua">target("qt_widgetapp")
     add_rules("qt.widgetapp")
-    add_files("src/*.cpp") 
+    add_files("src/*.cpp")
     add_files("src/mainwindow.ui")
     add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
 </code></pre>
 <p>!> 新版本提供了<code>qt.widgetapp</code>规则,内置了QtWidgets的内建规则,使用更加简单,下面老版本的<code>qt.application</code>还是支持的,向下兼容:</p>
 <pre><code class="lang-lua">target("qt_widgetapp")
     add_rules("qt.application")
-    add_files("src/*.cpp") 
+    add_files("src/*.cpp")
     add_files("src/mainwindow.ui")
     add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
     add_frameworks("QtWidgets")
@@ -226,7 +222,7 @@ build ok!
 <p>2.2.6之后版本,可以直接切到android平台编译Quick/Widgets应用程序,生成apk包,并且可通过<code>xmake install</code>命令安装到设备。</p>
 <pre><code class="lang-console">$ xmake create -t quickapp_qt -l c++ appdemo
 $ cd appdemo
-$ xmake f -p android --ndk=~/Downloads/android-ndk-r19c/ --android_sdk=~/Library/Android/sdk/ -c 
+$ xmake f -p android --ndk=~/Downloads/android-ndk-r19c/ --android_sdk=~/Library/Android/sdk/ -c
 $ xmake
 [  0%]: compiling.qt.qrc src/qml.qrc
 [ 50%]: ccache compiling.release src/main.cpp
@@ -242,7 +238,7 @@ install ok!👌
 </code></pre>
 <h2 id="wdk">WDK驱动程序</h2>
 <p>默认会自动探测wdk所在环境,当然也可以指定wdk sdk环境目录:</p>
-<pre><code class="lang-console">$ xmake f --wdk="G:\Program Files\Windows Kits\10" -c 
+<pre><code class="lang-console">$ xmake f --wdk="G:\Program Files\Windows Kits\10" -c
 $ xmake
 </code></pre>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/159">#159</a></p>
@@ -250,24 +246,24 @@ $ xmake
 <h3 id="umdf">umdf驱动程序</h3>
 <pre><code class="lang-lua">target("echo")
     add_rules("wdk.driver", "wdk.env.umdf")
-    add_files("driver/*.c") 
+    add_files("driver/*.c")
     add_files("driver/*.inx")
     add_includedirs("exe")
 
 target("app")
     add_rules("wdk.binary", "wdk.env.umdf")
-    add_files("exe/*.cpp") 
+    add_files("exe/*.cpp")
 </code></pre>
 <h3 id="kmdf">kmdf驱动程序</h3>
 <pre><code class="lang-lua">target("nonpnp")
     add_rules("wdk.driver", "wdk.env.kmdf")
     add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
-    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.c", {rule = "wdk.tracewpp"})
     add_files("driver/*.rc")
 
 target("app")
     add_rules("wdk.binary", "wdk.env.kmdf")
-    add_files("exe/*.c") 
+    add_files("exe/*.c")
     add_files("exe/*.inf")
 </code></pre>
 <h3 id="wdm">wdm驱动程序</h3>
@@ -277,15 +273,15 @@ target("app")
     add_values("wdk.man.resource", "kcsCounters.rc")
     add_values("wdk.man.header", "kcsCounters.h")
     add_values("wdk.man.counter_header", "kcsCounters_counters.h")
-    add_files("*.c", "*.rc", "*.man") 
+    add_files("*.c", "*.rc", "*.man")
 </code></pre>
 <pre><code class="lang-lua">target("msdsm")
     add_rules("wdk.driver", "wdk.env.wdm")
     add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
-    add_files("*.c", {rule = "wdk.tracewpp"}) 
+    add_files("*.c", {rule = "wdk.tracewpp"})
     add_files("*.rc", "*.inf")
     add_files("*.mof|msdsm.mof")
-    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}}) 
+    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}})
 </code></pre>
 <h3 id="">生成驱动包</h3>
 <p>可以通过以下命令生成.cab驱动包:</p>
@@ -419,12 +415,12 @@ $ xmake
 <p>那如何知道我们需要的签名配置呢?一种就是在xcode里面查看,另外xmake也提供了一些辅助工具可以dump出当前可用的所有签名配置:</p>
 <pre><code class="lang-console">$ xmake l private.tools.codesign.dump
 ==================================== codesign identities ====================================
-{ 
-  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1" 
+{
+  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1"
 }
 
 ===================================== mobile provisions =====================================
-{ 
+{
   "iOS Team Provisioning Profile: org.tboox.test" = "<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
@@ -527,22 +523,30 @@ target("cuda_console")
     -- generate PTX code for the virtual architecture to guarantee compatibility
     add_cugencodes("compute_30")
 </code></pre>
-<p><p class="tip"><br>从v2.2.7版本开始,默认构建会启用device-link。(参见 <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>如果要显示禁用device-link,可以通过<code>add_values("cuda.devlink", false)</code> 来设置。<br></p>
-
-</p>
+<p>!> 从v2.2.7版本开始,默认构建会启用device-link。(参见 <a href="https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/">Separate Compilation and Linking of CUDA C++ Device Code</a>)<br>如果要显示禁用device-link,可以通过<code>add_values("cuda.devlink", false)</code> 来设置。</p>
 <p>默认会自动探测cuda环境,当然也可以指定Cuda SDK环境目录:</p>
-<pre><code class="lang-console">$ xmake f --cuda=/usr/local/cuda-9.1/ 
+<pre><code class="lang-console">$ xmake f --cuda=/usr/local/cuda-9.1/
 $ xmake
 </code></pre>
 <p>更多详情可以参考:<a href="https://github.com/xmake-io/xmake/issues/158">#158</a></p>
-<h2 id="lexyacc">Lex&amp;Yacc程序</h2>
+<h2 id="lexyacc">Lex &amp; Yacc程序</h2>
 <pre><code class="lang-lua">target("calc")
     set_kind("binary")
     add_rules("lex", "yacc")
     add_files("src/*.l", "src/*.y")
 </code></pre>
+<h2 id="openmp">OpenMP 程序</h2>
+<pre><code class="lang-lua">add_requires("libomp", {optional = true})
+target("loop")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    add_rules("c++.openmp")
+    add_packages("libomp")
+</code></pre>
+<p>如果是c代码,需要启用 <code>add_rules("c.openmp")</code>,如果是 c/c++ 混合编译,那么这两个规则都要设置。</p>
 <h2 id="fortran">Fortran程序</h2>
 <p>v2.3.6之后版本开始支持gfortran编译器来编译fortran项目,我们可以通过下面的命令,快速创建一个基于fortran的空工程:</p>
+<p>v2.3.8之后,xmake 还支持 Intel Fortran Compiler,只需要切换下工具链即可:<code>xmake f --toolchain=ifort</code></p>
 <pre><code class="lang-console">$ xmake create -l fortran -t console test
 </code></pre>
 <p>它的xmake.lua内容如下:</p>

+ 61 - 27
mirror/zh-cn/manual/project_target.html

@@ -183,6 +183,11 @@ target("test2")
 <td>>= 1.0.1</td>
 </tr>
 <tr>
+<td><a href="#targetset_fpmodels">set_fpmodels</a></td>
+<td>设置float-point编译模式</td>
+<td>>= 2.3.8</td>
+</tr>
+<tr>
 <td><a href="#targetset_targetdir">set_targetdir</a></td>
 <td>设置生成目标文件目录</td>
 <td>>= 1.0.1</td>
@@ -1029,6 +1034,24 @@ set_optimize("fastest")
 <td>c语言标准: gnu99</td>
 </tr>
 <tr>
+<td>c11</td>
+<td>c语言标准: c11</td>
+</tr>
+<tr>
+<td>c17</td>
+<td>c语言标准: c17</td>
+</tr>
+</tbody>
+</table>
+<table>
+<thead>
+<tr>
+<th>值</th>
+<th>描述</th>
+</tr>
+</thead>
+<tbody>
+<tr>
 <td>cxx98</td>
 <td>c++语言标准: <code>c++98</code></td>
 </tr>
@@ -1074,9 +1097,20 @@ set_optimize("fastest")
 <pre><code class="lang-lua">-- 设置c代码标准:c99, c++代码标准:c++11
 set_languages("c99", "cxx11")
 </code></pre>
-<p><p class="warn"><br>并不是设置了指定的标准,编译器就一定会按这个标准来编译,毕竟每个编译器支持的力度不一样,但是xmake会尽最大可能的去适配当前编译工具的支持标准。。。<br><br><br><br>例如:<br><br><br>windows下vs的编译器并不支持按c99的标准来编译c代码,只能支持到c89,但是xmake为了尽可能的支持它,所以在设置c99的标准后,xmake会强制按c++代码模式去编译c代码,从一定程度上解决了windows下编译c99的c代码问题。。<br>用户不需要去额外做任何修改。。<br></p>
-
-</p>
+<p>并不是设置了指定的标准,编译器就一定会按这个标准来编译,毕竟每个编译器支持的力度不一样,但是xmake会尽最大可能的去适配当前编译工具的支持标准。</p>
+<p>msvc 的编译器并不支持按 c99 的标准来编译c代码,只能支持到c89,但是xmake为了尽可能的支持它,所以在设置c99的标准后,xmake会强制按c++代码模式去编译c代码,从一定程度上解决了windows下编译c99的c代码问题。。<br>用户不需要去额外做任何修改。</p>
+<p>不过最新的 msvc 编译已经支持上了 c11/c17 标准,xmake 也就不会再做额外的特殊处理。</p>
+<h3 id="targetset_fpmodels">target:set_fpmodels</h3>
+<h4 id="floatpoint">设置float-point编译模式</h4>
+<p>此接口用于设置浮点的编译模式,对数学计算相关优化的编译抽象设置,提供:fast, strict, except, precise 等几种常用的级别,有些可同时设置,有些是有冲突的,最后设置的生效。</p>
+<p>关于这些级别的说明,可以参考下微软的文档:<a href="https://docs.microsoft.com/en-us/cpp/build/reference/fp-specify-floating-point-behavior?view=vs-2019">Specify floating-point behavior</a></p>
+<p>当然,对应gcc/icc等其他编译器,xmake 会映射到不同的编译flags。</p>
+<pre><code class="lang-lua">set_fpmodels("fast")
+set_fpmodels("strict")
+set_fpmodels("fast", "except")
+set_fpmodels("precise") -- default
+</code></pre>
+<p>关于这块详情见:<a href="https://github.com/xmake-io/xmake/issues/981">https://github.com/xmake-io/xmake/issues/981</a></p>
 <h3 id="targetset_targetdir">target:set_targetdir</h3>
 <h4 id="">设置生成目标文件目录</h4>
 <p>设置目标程序文件的输出目录,一般情况下,不需要设置,默认会输出在build目录下</p>
@@ -1175,7 +1209,7 @@ target("test")
 <h4 id="">自定义链接脚本</h4>
 <p>这个是在v2.2.7之后新加的接口,用于定制化处理target的链接过程。</p>
 <pre><code class="lang-lua">target("test")
-    on_link(function (target) 
+    on_link(function (target)
         print("link it")
     end)
 </code></pre>
@@ -1186,7 +1220,7 @@ target("test")
 <pre><code class="lang-lua">target("test")
 
     -- 设置自定义编译脚本
-    on_build(function (target) 
+    on_build(function (target)
         print("build it")
     end)
 </code></pre>
@@ -1244,7 +1278,7 @@ target("test")
 <pre><code class="lang-lua">target("test")
 
     -- 设置自定义清理脚本
-    on_clean(function (target) 
+    on_clean(function (target)
 
         -- 仅删掉目标文件
         os.rm(target:targetfile())
@@ -1323,10 +1357,10 @@ target("demo")
     -- 设置自定义打包脚本,在使用xmake编译完libdemo.so后,执行xmake p进行打包
     -- 会自动使用ant将app编译成apk文件
     --
-    on_package(function (target) 
+    on_package(function (target)
 
         -- 使用ant编译app成apk文件,输出信息重定向到日志文件
-        os.run("ant debug") 
+        os.run("ant debug")
     end)
 </code></pre>
 <h3 id="targeton_install">target:on_install</h3>
@@ -1336,7 +1370,7 @@ target("demo")
 <pre><code class="lang-lua">target("test")
 
     -- 设置自定义安装脚本,自动安装apk文件
-    on_install(function (target) 
+    on_install(function (target)
 
         -- 使用adb安装打包生成的apk文件
         os.run("adb install -r ./bin/Demo-debug.apk")
@@ -1346,7 +1380,7 @@ target("demo")
 <h4 id="">自定义卸载脚本</h4>
 <p>覆盖target目标的<code>xmake [u|uninstall}</code>的卸载操作,实现自定义卸载过程。</p>
 <pre><code class="lang-lua">target("test")
-    on_uninstall(function (target) 
+    on_uninstall(function (target)
         ...
     end)
 </code></pre>
@@ -1357,7 +1391,7 @@ target("demo")
 <pre><code class="lang-lua">target("test")
 
     -- 设置自定义运行脚本,自动运行安装好的app程序,并且自动获取设备输出信息
-    on_run(function (target) 
+    on_run(function (target)
 
         os.run("adb shell am start -n com.demo/com.demo.DemoTest")
         os.run("adb logcat")
@@ -1367,7 +1401,7 @@ target("demo")
 <h4 id="">在链接之前执行一些自定义脚本</h4>
 <p>这个是在v2.2.7之后新加的接口,用于在链接之前增加一些自定义的操作。</p>
 <pre><code class="lang-lua">target("test")
-    before_link(function (target) 
+    before_link(function (target)
         print("")
     end)
 </code></pre>
@@ -1441,7 +1475,7 @@ target("demo")
 <h4 id="">在链接之后执行一些自定义脚本</h4>
 <p>这个是在v2.2.7之后新加的接口,用于在链接之后增加一些自定义的操作。</p>
 <pre><code class="lang-lua">target("test")
-    after_link(function (target) 
+    after_link(function (target)
         print("")
     end)
 </code></pre>
@@ -1565,7 +1599,7 @@ target("test")
 <pre><code class="lang-lua">add_deps("dep1", "dep2", {inherit = false})
 </code></pre>
 <p>通过显式设置inherit配置,来告诉xmake,这两个依赖的配置是否需要被继承,如果不设置,默认就是启用继承的。</p>
-<p>2.2.5版本之后,可通过 <code>add_includedirs("inc1", {public = true})</code>, 设置public为true, 将includedirs的设置公开给其他依赖的子target继承。 </p>
+<p>2.2.5版本之后,可通过 <code>add_includedirs("inc1", {public = true})</code>, 设置public为true, 将includedirs的设置公开给其他依赖的子target继承。</p>
 <p>目前对于target的编译链接flags相关接口设置,都是支持继承属性的,可以人为控制是否需要导出给其他target来依赖继承,目前支持的属性有:</p>
 <table>
 <thead>
@@ -1595,7 +1629,7 @@ target("test")
 <p>为当前目标添加链接库,一般这个要与<a href="#targetadd_linkdirs">add_linkdirs</a>配对使用。</p>
 <pre><code class="lang-lua">target("demo")
 
-    -- 添加对libtest.a的链接,相当于 -ltest 
+    -- 添加对libtest.a的链接,相当于 -ltest
     add_links("test")
 
     -- 添加链接搜索目录
@@ -1922,7 +1956,7 @@ target("test")
 </code></pre>
 <p>v2.2.3之后,还支持覆写内置的links,控制实际链接的库:</p>
 <pre><code class="lang-lua">-- 默认会有 ncurses, panel, form等links
-add_requires("ncurses") 
+add_requires("ncurses")
 
 target("test")
 
@@ -2344,7 +2378,7 @@ target("test")
 </code></pre>
 <p>的方式,来重命名输出,同样,这个接口跟<a href="#targetadd_configfiles">add_installfiles</a>类似,也是支持prefixdir和子目录提取设置:</p>
 <pre><code class="lang-lua">add_configfiles("src/*.h.in", {prefixdir = "subdir"})
-add_configfiles("src/(tbox/config.h)") 
+add_configfiles("src/(tbox/config.h)")
 </code></pre>
 <p>这个接口的一个最重要的特性就是,可以在预处理的时候,对里面的一些模板变量进行预处理替换,例如:</p>
 <p>config.h.in</p>
@@ -2398,7 +2432,7 @@ ${OS} and ${os} -> IOS or ios
 #define CONFIG_VERSION_BUILD 201902031401
 </code></pre>
 <p>我们还可以对<code>#define</code>定义进行一些变量状态控制处理:</p>
-<p>config.h.in </p>
+<p>config.h.in</p>
 <pre><code class="lang-c">${define FOO_ENABLE}
 </code></pre>
 <pre><code class="lang-lua">set_configvar("FOO_ENABLE", 1) -- or pass true
@@ -2423,7 +2457,7 @@ target("test")
     add_configfiles("config.h.in")
 
     -- 如果启用foo选项 -> 添加 FOO_ENABLE 和 FOO_STRING 定义
-    add_options("foo") 
+    add_options("foo")
 </code></pre>
 <p>config.h.in</p>
 <pre><code class="lang-c">${define FOO_ENABLE}
@@ -2483,22 +2517,22 @@ ${define FOO_STRING}
 </table>
 <p>如果要获取当前xmake支持的所有策略配置列表和描述,可以执行下面的命令:</p>
 <pre><code class="lang-bash">$ xmake l core.project.policy.policies
-{ 
-  "check.auto_map_flags" = { 
+{
+  "check.auto_map_flags" = {
     type = "boolean",
     description = "Enable map gcc flags to the current compiler and linker automatically.",
-    default = true 
+    default = true
   },
-  "build.across_targets_in_parallel" = { 
+  "build.across_targets_in_parallel" = {
     type = "boolean",
     description = "Enable compile the source files for each target in parallel.",
-    default = true 
+    default = true
   },
-  "check.auto_ignore_flags" = { 
+  "check.auto_ignore_flags" = {
     type = "boolean",
     description = "Enable check and ignore unsupported flags automatically.",
-    default = true 
-  } 
+    default = true
+  }
 }
 </code></pre>
 <h5 id="checkauto_ignore_flags">check.auto_ignore_flags</h5>

+ 75 - 75
sitemap.xml

@@ -12,377 +12,377 @@
 
 <url>
   <loc>https://xmake.io/mirror/guide/project_examples.html</loc>
-  <lastmod>2020-10-14T21:21:47+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/other_features.html</loc>
-  <lastmod>2020-10-14T21:21:47+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:43+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/quickstart.html</loc>
-  <lastmod>2020-10-14T21:21:47+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/faq.html</loc>
-  <lastmod>2020-10-14T21:21:47+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/configuration.html</loc>
-  <lastmod>2020-10-14T21:21:48+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/syntax_description.html</loc>
-  <lastmod>2020-10-14T21:21:48+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/guide/installation.html</loc>
-  <lastmod>2020-10-14T21:21:48+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/plugin_development.html</loc>
-  <lastmod>2020-10-14T21:21:48+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:44+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/more_plugins.html</loc>
-  <lastmod>2020-10-14T21:21:48+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/plugin/builtin_plugins.html</loc>
-  <lastmod>2020-10-14T21:21:48+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/zh/plugins.html</loc>
-  <lastmod>2020-10-14T21:21:49+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/zh/manual.html</loc>
-  <lastmod>2020-10-14T21:21:49+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/plugins.html</loc>
-  <lastmod>2020-10-14T21:21:49+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/old/manual.html</loc>
-  <lastmod>2020-10-14T21:21:49+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:45+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/awesome.html</loc>
-  <lastmod>2020-10-14T21:21:49+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/technical_support.html</loc>
-  <lastmod>2020-10-14T21:21:50+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/changelog.html</loc>
-  <lastmod>2020-10-14T21:21:50+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/contact.html</loc>
-  <lastmod>2020-10-14T21:21:50+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/introduction.html</loc>
-  <lastmod>2020-10-14T21:21:50+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:46+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/about/sponsor.html</loc>
-  <lastmod>2020-10-14T21:21:50+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/index.html</loc>
-  <lastmod>2020-10-14T21:21:50+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/project_examples.html</loc>
-  <lastmod>2020-10-14T21:21:51+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/other_features.html</loc>
-  <lastmod>2020-10-14T21:21:51+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/quickstart.html</loc>
-  <lastmod>2020-10-14T21:21:51+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/faq.html</loc>
-  <lastmod>2020-10-14T21:21:51+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:47+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/configuration.html</loc>
-  <lastmod>2020-10-14T21:21:51+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/syntax_description.html</loc>
-  <lastmod>2020-10-14T21:21:51+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/guide/installation.html</loc>
-  <lastmod>2020-10-14T21:21:52+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/plugin_development.html</loc>
-  <lastmod>2020-10-14T21:21:52+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/more_plugins.html</loc>
-  <lastmod>2020-10-14T21:21:52+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/plugin/builtin_plugins.html</loc>
-  <lastmod>2020-10-14T21:21:52+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:48+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/awesome.html</loc>
-  <lastmod>2020-10-14T21:21:52+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/technical_support.html</loc>
-  <lastmod>2020-10-14T21:21:52+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/changelog.html</loc>
-  <lastmod>2020-10-14T21:21:53+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/contact.html</loc>
-  <lastmod>2020-10-14T21:21:53+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/introduction.html</loc>
-  <lastmod>2020-10-14T21:21:53+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/sponsor.html</loc>
-  <lastmod>2020-10-14T21:21:53+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:49+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/about/course.html</loc>
-  <lastmod>2020-10-14T21:21:53+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/index.html</loc>
-  <lastmod>2020-10-14T21:21:53+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/getting_started.html</loc>
-  <lastmod>2020-10-14T21:21:54+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/specification.html</loc>
-  <lastmod>2020-10-14T21:21:54+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_variables.html</loc>
-  <lastmod>2020-10-14T21:21:54+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/conditions.html</loc>
-  <lastmod>2020-10-14T21:21:54+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:50+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_rule.html</loc>
-  <lastmod>2020-10-14T21:21:54+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/project_target.html</loc>
-  <lastmod>2020-10-14T21:21:54+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/builtin_modules.html</loc>
-  <lastmod>2020-10-14T21:21:55+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/custom_toolchain.html</loc>
-  <lastmod>2020-10-14T21:21:55+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/plugin_task.html</loc>
-  <lastmod>2020-10-14T21:21:55+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/package_dependencies.html</loc>
-  <lastmod>2020-10-14T21:21:55+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:51+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/configuration_option.html</loc>
-  <lastmod>2020-10-14T21:21:55+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/extension_modules.html</loc>
-  <lastmod>2020-10-14T21:21:55+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/manual/global_interfaces.html</loc>
-  <lastmod>2020-10-14T21:21:56+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/builtin_themes.html</loc>
-  <lastmod>2020-10-14T21:21:56+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/theme/switch_theme.html</loc>
-  <lastmod>2020-10-14T21:21:56+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:52+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/local_package.html</loc>
-  <lastmod>2020-10-14T21:21:56+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/system_package.html</loc>
-  <lastmod>2020-10-14T21:21:56+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/zh-cn/package/remote_package.html</loc>
-  <lastmod>2020-10-14T21:21:56+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/getting_started.html</loc>
-  <lastmod>2020-10-14T21:21:57+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/specification.html</loc>
-  <lastmod>2020-10-14T21:21:57+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_variables.html</loc>
-  <lastmod>2020-10-14T21:21:57+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:53+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/conditions.html</loc>
-  <lastmod>2020-10-14T21:21:57+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_rule.html</loc>
-  <lastmod>2020-10-14T21:21:57+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/project_target.html</loc>
-  <lastmod>2020-10-14T21:21:57+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/builtin_modules.html</loc>
-  <lastmod>2020-10-14T21:21:58+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/custom_toolchain.html</loc>
-  <lastmod>2020-10-14T21:21:58+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/plugin_task.html</loc>
-  <lastmod>2020-10-14T21:21:58+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:54+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/package_dependencies.html</loc>
-  <lastmod>2020-10-14T21:21:58+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/configuration_option.html</loc>
-  <lastmod>2020-10-14T21:21:58+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/extension_modules.html</loc>
-  <lastmod>2020-10-14T21:21:59+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/manual/global_interfaces.html</loc>
-  <lastmod>2020-10-14T21:21:59+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/builtin_themes.html</loc>
-  <lastmod>2020-10-14T21:21:59+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/theme/switch_theme.html</loc>
-  <lastmod>2020-10-14T21:21:59+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:55+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/local_package.html</loc>
-  <lastmod>2020-10-14T21:21:59+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/system_package.html</loc>
-  <lastmod>2020-10-14T21:21:59+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:56+08:00</lastmod>
 </url>
 
 <url>
   <loc>https://xmake.io/mirror/package/remote_package.html</loc>
-  <lastmod>2020-10-14T21:22:00+08:00</lastmod>
+  <lastmod>2020-10-17T00:04:56+08:00</lastmod>
 </url>
 
 </urlset>

+ 79 - 8
zh-cn/guide/configuration.md

@@ -41,9 +41,7 @@ $ xmake f -p android --ndk=~/files/android-ndk-r10e/ -a arm64-v8a --bin=~/files/
 
 [--bin](#-bin)主要用于设置选择编译工具的具体bin目录,这个的使用跟[交叉编译](#交叉编译)中的[--bin](#-bin)的行为是一致的。
 
-<p class="tip">
-如果手动设置了bin目录,没有通过检测,可以看下是否`--arch=`参数没有匹配对。
-</p>
+!> 如果手动设置了bin目录,没有通过检测,可以看下是否`--arch=`参数没有匹配对。
 
 ### iPhoneOS
 
@@ -61,10 +59,12 @@ $ xmake
 
 ### Mingw
 
+xmake 除了支持 Msys2/MingW, MingW for macOS/linux 之外,还支持 llvm-mingw 工具链,可以切换 arm/arm64 架构来编译。
+
 ```bash
-$ xmake f -p mingw --sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64]
+$ xmake f -p mingw --sdk=/usr/local/i386-mingw32-4.3.0/ [-a i386|x86_64|arm|arm64]
 $ xmake
-``` 
+```
 
 ### Apple WatchOS
 
@@ -73,6 +73,31 @@ $ xmake f -p watchos [-a i386|armv7k]
 $ xmake
 ```
 
+### Wasm (WebAssembly)
+
+此平台用于编译 WebAssembly 程序(内部会使用emcc工具链),在切换此平台之前,我们需要先进入 Emscripten 工具链环境,确保 emcc 等编译器可用。
+
+```bash
+$ xmake f -p wasm
+$ xmake
+```
+
+xmake 也支持 Qt for wasm 编译,只需要:
+
+```bash
+$ xmake f -p wasm [--qt=~/Qt]
+$ xmake
+```
+
+其中 `--qt` 参数设置是可选的,通常xmake都能检测到qt的sdk路径。
+
+
+需要注意的一点是,Emscripten 和 Qt SDK 的版本是有对应关系的,不匹配的版本,可能会有Qt/Wasm之间的兼容问题。
+
+关于版本对应关系,可以看下:[https://wiki.qt.io/Qt_for_WebAssembly](https://wiki.qt.io/Qt_for_WebAssembly)
+
+更多详情见:[https://github.com/xmake-io/xmake/issues/956](https://github.com/xmake-io/xmake/issues/956)
+
 ## 交叉编译配置
 
 通常,如果我们需要在当前pc环境编译生成其他设备上才能运行的目标文件时候,就需要通过对应的交叉编译工具链来编译生成它们,比如在win/macos上编译linux的程序,或者在linux上编译其他嵌入式设备的目标文件等。
@@ -415,7 +440,7 @@ toolchain("myclang")
 
 更多详情见:[#780](https://github.com/xmake-io/xmake/issues/780)
 
-#### MingW工具链
+#### MingW 工具链
 
 使用mingw工具链编译,其实也是交叉编译,但是由于这个比较常用,xmake专门增加了一个mingw的平台来快速处理使用mingw工具链的编译。
 
@@ -464,7 +489,14 @@ $ xmake
 
 另外,其他的工具链配置参数用法,跟上文描述的没什么区别,像`--cross`, `--bin=`等都可以根据实际的环境需要,自己控制是否需要额外追加配置来适配自己的mingw工具链。
 
-#### LLVM工具链
+xmake 还支持 llvm-mingw 工具链,可以切换到 arm/arm64 架构来编译。
+
+```bash
+$ xmake f --mingw=/xxx/llvm-mingw -a arm64
+$ xmake
+```
+
+#### LLVM 工具链
 
 llvm工具链下载地址:https://releases.llvm.org/
 
@@ -473,7 +505,7 @@ $ xmake f -p cross --toolchain=llvm --sdk="C:\Program Files\LLVM"
 $ xmake
 ```
 
-#### GNU-RM工具链
+#### GNU-RM 工具链
 
 工具链地址:https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads#
 
@@ -482,6 +514,45 @@ $ xmake f -p cross --toolchain=gnu-rm --sdk=/xxx/cc-arm-none-eabi-9-2019-q4-majo
 $ xmake
 ```
 
+#### TinyC 工具链
+
+```bash
+$ xmake f --toolchain=tinyc
+$ xmake
+```
+
+!> Releases目录下,我们还提供了特殊的 xmake-tinyc-vX.X.X.win32.exe 安装包,内置tinyc工具链,无需依赖msvc,也可以编译c代码,开箱即用无依赖。
+
+#### Emcc 工具链
+
+通常只需要切换到 Wasm 平台,里面内置了 emcc 工具链,还会额外调整目标程序的扩展名为 `*.html` 以及输出 `*.wasm`。
+
+```bash
+$ xmake f -p wasm
+$ xmake
+```
+
+不过我们也能够直接切换到 emcc 工具链,但是后缀名不会被修改。
+
+```bash
+$ xmake f --toolchain=emcc
+$ xmake
+```
+
+#### Intel C++ 编译工具链
+
+```bash
+$ xmake f --toolchain=icc
+$ xmake
+```
+
+#### Intel Fortran 编译工具链
+
+```bash
+$ xmake f --toolchain=ifort
+$ xmake
+```
+
 ### 通用交叉编译配置
 
 | 参数名                       | 描述                             |

+ 42 - 33
zh-cn/guide/project_examples.md

@@ -95,16 +95,22 @@ $ xmake create -l c++ -t quickapp_qt test
 $ xmake f --qt=~/Qt/Qt5.9.1
 ```
 
-如果想要使用windows下mingw的Qt环境,可以切到mingw的平台配置,并且指定下mingw编译环境的sdk路径即可,例如:
+如果想要使用 windows 下 MingW 的 Qt 环境,可以切到mingw的平台配置,并且指定下mingw编译环境的sdk路径即可,例如:
 
 ```console
-$ xmake f -p mingw --sdk=C:\Qt\Qt5.10.1\Tools\mingw530_32 
+$ xmake f -p mingw --sdk=C:\Qt\Qt5.10.1\Tools\mingw530_32
 ```
 
-上述指定的mingw sdk用的是Qt下Tools目录自带的环境,当然如果有其他第三方mingw编译环境,也可以手动指定, 具体可以参考:[mingw编译配置](#mingw)。
+上述指定的 MingW SDK 用的是Qt下Tools目录自带的环境,当然如果有其他第三方 MingW 编译环境,也可以手动指定, 具体可以参考:[MingW 编译配置](/zh-cn/guide/configuration?id=mingw)。
 
 更多详情可以参考:[#160](https://github.com/xmake-io/xmake/issues/160)
 
+另外,当前xmake也支持Qt/Wasm,详情见:[Wasm 配置](/zh-cn/guide/configuration?id=wasm)
+
+```console
+$ xmake f -p wasm
+```
+
 ### 静态库程序
 
 ```lua
@@ -138,18 +144,8 @@ v2.2.9以上版本:
 ```lua
 target("qt_quickapp")
     add_rules("qt.quickapp")
-    add_files("src/*.cpp") 
-    add_files("src/qml.qrc")
-```
-
-!> 新版本提供了`qt.quickapp`规则,内置了QtQuick的内建规则,使用更加简单,下面老版本的`qt.application`还是支持的,向下兼容:
-
-```lua
-target("qt_quickapp")
-    add_rules("qt.application")
-    add_files("src/*.cpp") 
+    add_files("src/*.cpp")
     add_files("src/qml.qrc")
-    add_frameworks("QtQuick")
 ```
 
 !> 如果使用的自己编译的static版本QT SDK,那么需要切换到`add_rules("qt.quickapp_static")`静态规则才行,因为链接的库是不同的,需要做静态链接。
@@ -186,7 +182,7 @@ v2.2.9以上版本:
 ```lua
 target("qt_widgetapp")
     add_rules("qt.widgetapp")
-    add_files("src/*.cpp") 
+    add_files("src/*.cpp")
     add_files("src/mainwindow.ui")
     add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
 ```
@@ -196,7 +192,7 @@ target("qt_widgetapp")
 ```lua
 target("qt_widgetapp")
     add_rules("qt.application")
-    add_files("src/*.cpp") 
+    add_files("src/*.cpp")
     add_files("src/mainwindow.ui")
     add_files("src/mainwindow.h")  -- 添加带有 Q_OBJECT 的meta头文件
     add_frameworks("QtWidgets")
@@ -216,7 +212,7 @@ target("qt_widgetapp")
 ```console
 $ xmake create -t quickapp_qt -l c++ appdemo
 $ cd appdemo
-$ xmake f -p android --ndk=~/Downloads/android-ndk-r19c/ --android_sdk=~/Library/Android/sdk/ -c 
+$ xmake f -p android --ndk=~/Downloads/android-ndk-r19c/ --android_sdk=~/Library/Android/sdk/ -c
 $ xmake
 [  0%]: compiling.qt.qrc src/qml.qrc
 [ 50%]: ccache compiling.release src/main.cpp
@@ -239,7 +235,7 @@ install ok!👌
 默认会自动探测wdk所在环境,当然也可以指定wdk sdk环境目录:
 
 ```console
-$ xmake f --wdk="G:\Program Files\Windows Kits\10" -c 
+$ xmake f --wdk="G:\Program Files\Windows Kits\10" -c
 $ xmake
 ```
 
@@ -252,13 +248,13 @@ $ xmake
 ```lua
 target("echo")
     add_rules("wdk.driver", "wdk.env.umdf")
-    add_files("driver/*.c") 
+    add_files("driver/*.c")
     add_files("driver/*.inx")
     add_includedirs("exe")
 
 target("app")
     add_rules("wdk.binary", "wdk.env.umdf")
-    add_files("exe/*.cpp") 
+    add_files("exe/*.cpp")
 ```
 
 ### kmdf驱动程序
@@ -267,12 +263,12 @@ target("app")
 target("nonpnp")
     add_rules("wdk.driver", "wdk.env.kmdf")
     add_values("wdk.tracewpp.flags", "-func:TraceEvents(LEVEL,FLAGS,MSG,...)", "-func:Hexdump((LEVEL,FLAGS,MSG,...))")
-    add_files("driver/*.c", {rule = "wdk.tracewpp"}) 
+    add_files("driver/*.c", {rule = "wdk.tracewpp"})
     add_files("driver/*.rc")
 
 target("app")
     add_rules("wdk.binary", "wdk.env.kmdf")
-    add_files("exe/*.c") 
+    add_files("exe/*.c")
     add_files("exe/*.inf")
 ```
 
@@ -285,17 +281,17 @@ target("kcs")
     add_values("wdk.man.resource", "kcsCounters.rc")
     add_values("wdk.man.header", "kcsCounters.h")
     add_values("wdk.man.counter_header", "kcsCounters_counters.h")
-    add_files("*.c", "*.rc", "*.man") 
+    add_files("*.c", "*.rc", "*.man")
 ```
 
 ```lua
 target("msdsm")
     add_rules("wdk.driver", "wdk.env.wdm")
     add_values("wdk.tracewpp.flags", "-func:TracePrint((LEVEL,FLAGS,MSG,...))")
-    add_files("*.c", {rule = "wdk.tracewpp"}) 
+    add_files("*.c", {rule = "wdk.tracewpp"})
     add_files("*.rc", "*.inf")
     add_files("*.mof|msdsm.mof")
-    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}}) 
+    add_files("msdsm.mof", {values = {wdk_mof_header = "msdsmwmi.h"}})
 ```
 
 ### 生成驱动包
@@ -502,12 +498,12 @@ target("test")
 ```console
 $ xmake l private.tools.codesign.dump
 ==================================== codesign identities ====================================
-{ 
-  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1" 
+{
+  "Apple Development: [email protected] (T3NA4MRVPU)" = "AF73C231A0C35335B72761BD3759694739D34EB1"
 }
 
 ===================================== mobile provisions =====================================
-{ 
+{
   "iOS Team Provisioning Profile: org.tboox.test" = "<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
@@ -666,21 +662,19 @@ target("cuda_console")
     add_cugencodes("compute_30")
 ```
 
-<p class="tip">
-从v2.2.7版本开始,默认构建会启用device-link。(参见 [Separate Compilation and Linking of CUDA C++ Device Code](https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/))
+!> 从v2.2.7版本开始,默认构建会启用device-link。(参见 [Separate Compilation and Linking of CUDA C++ Device Code](https://devblogs.nvidia.com/separate-compilation-linking-cuda-device-code/))
 如果要显示禁用device-link,可以通过`add_values("cuda.devlink", false)` 来设置。
-</p>
 
 默认会自动探测cuda环境,当然也可以指定Cuda SDK环境目录:
 
 ```console
-$ xmake f --cuda=/usr/local/cuda-9.1/ 
+$ xmake f --cuda=/usr/local/cuda-9.1/
 $ xmake
 ```
 
 更多详情可以参考:[#158](https://github.com/xmake-io/xmake/issues/158)
 
-## Lex&Yacc程序
+## Lex & Yacc程序
 
 ```lua
 target("calc")
@@ -689,10 +683,25 @@ target("calc")
     add_files("src/*.l", "src/*.y")
 ```
 
+## OpenMP 程序
+
+```lua
+add_requires("libomp", {optional = true})
+target("loop")
+    set_kind("binary")
+    add_files("src/*.cpp")
+    add_rules("c++.openmp")
+    add_packages("libomp")
+```
+
+如果是c代码,需要启用 `add_rules("c.openmp")`,如果是 c/c++ 混合编译,那么这两个规则都要设置。
+
 ## Fortran程序
 
 v2.3.6之后版本开始支持gfortran编译器来编译fortran项目,我们可以通过下面的命令,快速创建一个基于fortran的空工程:
 
+v2.3.8之后,xmake 还支持 Intel Fortran Compiler,只需要切换下工具链即可:`xmake f --toolchain=ifort`
+
 ```console
 $ xmake create -l fortran -t console test
 ```

+ 65 - 42
zh-cn/manual/project_target.md

@@ -38,6 +38,7 @@ target("test2")
 | [set_warnings](#targetset_warnings)             | 设置警告级别                         | >= 1.0.1 |
 | [set_optimize](#targetset_optimize)             | 设置优化级别                         | >= 1.0.1 |
 | [set_languages](#targetset_languages)           | 设置代码语言标准                     | >= 1.0.1 |
+| [set_fpmodels](#targetset_fpmodels)             | 设置float-point编译模式              | >= 2.3.8 |
 | [set_targetdir](#targetset_targetdir)           | 设置生成目标文件目录                 | >= 1.0.1 |
 | [set_objectdir](#targetset_objectdir)           | 设置对象文件生成目录                 | >= 1.0.1 |
 | [set_dependir](#targetset_dependir)             | 设置依赖文件生成目录                 | >= 2.2.2 |
@@ -494,6 +495,11 @@ set_optimize("fastest")
 | gnu89      | c语言标准: gnu89       |
 | c99        | c语言标准: c99         |
 | gnu99      | c语言标准: gnu99       |
+| c11        | c语言标准: c11         |
+| c17        | c语言标准: c17         |
+
+| 值         | 描述                   |
+| ---------- | ---------------------- |
 | cxx98      | c++语言标准: `c++98`   |
 | gnuxx98    | c++语言标准: `gnu++98` |
 | cxx11      | c++语言标准: `c++11`   |
@@ -512,14 +518,31 @@ c标准和c++标准可同时进行设置,例如:
 set_languages("c99", "cxx11")
 ```
 
-<p class="warn">
-并不是设置了指定的标准,编译器就一定会按这个标准来编译,毕竟每个编译器支持的力度不一样,但是xmake会尽最大可能的去适配当前编译工具的支持标准。。。
-<br><br>
-例如:
-<br>
-windows下vs的编译器并不支持按c99的标准来编译c代码,只能支持到c89,但是xmake为了尽可能的支持它,所以在设置c99的标准后,xmake会强制按c++代码模式去编译c代码,从一定程度上解决了windows下编译c99的c代码问题。。
-用户不需要去额外做任何修改。。
-</p>
+并不是设置了指定的标准,编译器就一定会按这个标准来编译,毕竟每个编译器支持的力度不一样,但是xmake会尽最大可能的去适配当前编译工具的支持标准。
+
+msvc 的编译器并不支持按 c99 的标准来编译c代码,只能支持到c89,但是xmake为了尽可能的支持它,所以在设置c99的标准后,xmake会强制按c++代码模式去编译c代码,从一定程度上解决了windows下编译c99的c代码问题。。
+用户不需要去额外做任何修改。
+
+不过最新的 msvc 编译已经支持上了 c11/c17 标准,xmake 也就不会再做额外的特殊处理。
+
+### target:set_fpmodels
+
+#### 设置float-point编译模式
+
+此接口用于设置浮点的编译模式,对数学计算相关优化的编译抽象设置,提供:fast, strict, except, precise 等几种常用的级别,有些可同时设置,有些是有冲突的,最后设置的生效。
+
+关于这些级别的说明,可以参考下微软的文档:[Specify floating-point behavior](https://docs.microsoft.com/en-us/cpp/build/reference/fp-specify-floating-point-behavior?view=vs-2019)
+
+当然,对应gcc/icc等其他编译器,xmake 会映射到不同的编译flags。
+
+```lua
+set_fpmodels("fast")
+set_fpmodels("strict")
+set_fpmodels("fast", "except")
+set_fpmodels("precise") -- default
+```
+
+关于这块详情见:[https://github.com/xmake-io/xmake/issues/981](https://github.com/xmake-io/xmake/issues/981)
 
 ### target:set_targetdir
 
@@ -586,13 +609,13 @@ target("test")
     on_build(function (target)
         import("core.base.task")
         import("core.project.project")
-        
+
         task.run("xxxx")
     end)
     on_install(function (target)
         import("core.base.task")
         import("core.project.project")
-        
+
         task.run("xxxx")
     end)
 ```
@@ -629,7 +652,7 @@ rule("markdown")
 
 target("test")
     set_kind("binary")
-    
+
     -- 使test目标支持markdown文件的构建规则
     add_rules("markdown")
 
@@ -665,7 +688,7 @@ target("test")
 
 ```lua
 target("test")
-    on_link(function (target) 
+    on_link(function (target)
         print("link it")
     end)
 ```
@@ -682,7 +705,7 @@ target("test")
 target("test")
 
     -- 设置自定义编译脚本
-    on_build(function (target) 
+    on_build(function (target)
         print("build it")
     end)
 ```
@@ -767,7 +790,7 @@ target("test")
 target("test")
 
     -- 设置自定义清理脚本
-    on_clean(function (target) 
+    on_clean(function (target)
 
         -- 仅删掉目标文件
         os.rm(target:targetfile())
@@ -816,10 +839,10 @@ target("demo")
     -- 设置自定义打包脚本,在使用xmake编译完libdemo.so后,执行xmake p进行打包
     -- 会自动使用ant将app编译成apk文件
     --
-    on_package(function (target) 
+    on_package(function (target)
 
         -- 使用ant编译app成apk文件,输出信息重定向到日志文件
-        os.run("ant debug") 
+        os.run("ant debug")
     end)
 ```
 
@@ -835,7 +858,7 @@ target("demo")
 target("test")
 
     -- 设置自定义安装脚本,自动安装apk文件
-    on_install(function (target) 
+    on_install(function (target)
 
         -- 使用adb安装打包生成的apk文件
         os.run("adb install -r ./bin/Demo-debug.apk")
@@ -850,7 +873,7 @@ target("test")
 
 ```lua
 target("test")
-    on_uninstall(function (target) 
+    on_uninstall(function (target)
         ...
     end)
 ```
@@ -867,7 +890,7 @@ target("test")
 target("test")
 
     -- 设置自定义运行脚本,自动运行安装好的app程序,并且自动获取设备输出信息
-    on_run(function (target) 
+    on_run(function (target)
 
         os.run("adb shell am start -n com.demo/com.demo.DemoTest")
         os.run("adb logcat")
@@ -882,7 +905,7 @@ target("test")
 
 ```lua
 target("test")
-    before_link(function (target) 
+    before_link(function (target)
         print("")
     end)
 ```
@@ -902,7 +925,7 @@ target("test")
 
 ### target:before_build_file
 
-#### 自定义编译前的脚本, 实现单文件构建 
+#### 自定义编译前的脚本, 实现单文件构建
 
 通过此接口,可以用来hook指定target内置的构建过程,在每个源文件编译过程之前执行一些自定义脚本:
 
@@ -916,7 +939,7 @@ target("test")
 
 ### target:before_build_files
 
-#### 自定义编译前的脚本, 实现多文件构建 
+#### 自定义编译前的脚本, 实现多文件构建
 
 通过此接口,可以用来hook指定target内置的构建过程,在一批同类型源文件编译过程之前执行一些自定义脚本:
 
@@ -1001,7 +1024,7 @@ target("test")
 
 ```lua
 target("test")
-    after_link(function (target) 
+    after_link(function (target)
         print("")
     end)
 ```
@@ -1023,7 +1046,7 @@ target("test")
 
 ### target:after_build_file
 
-#### 自定义编译前的脚本, 实现单文件构建 
+#### 自定义编译前的脚本, 实现单文件构建
 
 通过此接口,可以用来hook指定target内置的构建过程,在每个源文件编译过程之后执行一些自定义脚本:
 
@@ -1037,7 +1060,7 @@ target("test")
 
 ### target:after_build_files
 
-#### 自定义编译前的脚本, 实现多文件构建 
+#### 自定义编译前的脚本, 实现多文件构建
 
 通过此接口,可以用来hook指定target内置的构建过程,在一批同类型源文件编译过程之后执行一些自定义脚本:
 
@@ -1193,7 +1216,7 @@ add_deps("dep1", "dep2", {inherit = false})
 
 通过显式设置inherit配置,来告诉xmake,这两个依赖的配置是否需要被继承,如果不设置,默认就是启用继承的。
 
-2.2.5版本之后,可通过 `add_includedirs("inc1", {public = true})`, 设置public为true, 将includedirs的设置公开给其他依赖的子target继承。 
+2.2.5版本之后,可通过 `add_includedirs("inc1", {public = true})`, 设置public为true, 将includedirs的设置公开给其他依赖的子target继承。
 
 目前对于target的编译链接flags相关接口设置,都是支持继承属性的,可以人为控制是否需要导出给其他target来依赖继承,目前支持的属性有:
 
@@ -1214,7 +1237,7 @@ add_deps("dep1", "dep2", {inherit = false})
 ```lua
 target("demo")
 
-    -- 添加对libtest.a的链接,相当于 -ltest 
+    -- 添加对libtest.a的链接,相当于 -ltest
     add_links("test")
 
     -- 添加链接搜索目录
@@ -1467,7 +1490,7 @@ add_undefines("DEBUG")
 
 ### target:add_cflags
 
-#### 添加c编译选项 
+#### 添加c编译选项
 
 仅对c代码添加编译选项
 
@@ -1501,7 +1524,7 @@ add_cflags("-g", "-O2", {force = true})
 
 ### target:add_mflags
 
-#### 添加objc编译选项 
+#### 添加objc编译选项
 
 仅对objc代码添加编译选项
 
@@ -1740,10 +1763,10 @@ v2.2.3之后,还支持覆写内置的links,控制实际链接的库:
 
 ```lua
 -- 默认会有 ncurses, panel, form等links
-add_requires("ncurses") 
+add_requires("ncurses")
 
 target("test")
-    
+
     -- 显示指定,只使用ncurses一个链接库
     add_packages("ncurses", {links = "ncurses"})
 ```
@@ -2216,7 +2239,7 @@ add_configfiles("src/config.h", {filename = "myconfig.h"})
 
 ```lua
 add_configfiles("src/*.h.in", {prefixdir = "subdir"})
-add_configfiles("src/(tbox/config.h)") 
+add_configfiles("src/(tbox/config.h)")
 ```
 
 这个接口的一个最重要的特性就是,可以在预处理的时候,对里面的一些模板变量进行预处理替换,例如:
@@ -2299,7 +2322,7 @@ config.h
 
 我们还可以对`#define`定义进行一些变量状态控制处理:
 
-config.h.in 
+config.h.in
 
 ```c
 ${define FOO_ENABLE}
@@ -2337,7 +2360,7 @@ target("test")
     add_configfiles("config.h.in")
 
     -- 如果启用foo选项 -> 添加 FOO_ENABLE 和 FOO_STRING 定义
-    add_options("foo") 
+    add_options("foo")
 ```
 
 config.h.in
@@ -2401,22 +2424,22 @@ target("test")
 
 ```bash
 $ xmake l core.project.policy.policies
-{ 
-  "check.auto_map_flags" = { 
+{
+  "check.auto_map_flags" = {
     type = "boolean",
     description = "Enable map gcc flags to the current compiler and linker automatically.",
-    default = true 
+    default = true
   },
-  "build.across_targets_in_parallel" = { 
+  "build.across_targets_in_parallel" = {
     type = "boolean",
     description = "Enable compile the source files for each target in parallel.",
-    default = true 
+    default = true
   },
-  "check.auto_ignore_flags" = { 
+  "check.auto_ignore_flags" = {
     type = "boolean",
     description = "Enable check and ignore unsupported flags automatically.",
-    default = true 
-  } 
+    default = true
+  }
 }
 ```