![]() If our cross-compilation tool chain is the above structure, Xmake will automatically detect and identify the structure of the SDK, extract the cross and include/lib path location, users usually do not need to do additional parameter settings, just configure the SDK The root directory can be compiled, for example: $ xmake f -p cross -sdk=/home/toolchains_sdkdirĪmong them, -p cross is used to specify that the current platform is a cross-compilation platform, and -sdk= is used to specify the root directory of the cross toolchain. nm is used to view the list of exported symbols. When linking, it will internally call ld to link, and automatically add some c++ libraries.Ĭpp is a preprocessor, as is an assembler, ar is used to generate a static library, and strip is used to crop out some symbol information, making the target program smaller. The gcc/g++ inside is the c/c++ compiler, which can also be used as a linker. The arm-linux-armeabi- prefix is cross, which is used to mark the target platform and architecture, and is mainly used to distinguish it from the host's own gcc/clang. The usual cross-compilation tool chain is based on gcc/clang, and most of them have a structure similar to the following: /home/toolchains_sdkdirĮach toolchain has a corresponding include/lib directory, which is used to place some system libraries and header files, such as libc, stdc++, etc., and a series of tools for compiling the tool chain are placed under the bin directory. Generally, if we need to compile and generate object files that can be run on other devices in the current pc environment, we need to compile and generate them through the corresponding cross-compilation tool chain, such as compiling linux programs on win/macos, or Compile object files of other embedded devices, etc. $ xmake f -p wasm -toolchain=wasiĪpple WatchOS $ xmake f -p watchos In addition to emscripten, there is a common wasi-sdk toolchain for building wasi-based programs, and we just need to switch between toolchains. Regarding the version correspondence, you can see: If the version does not match, there may be compatibility issues between Qt/Wasm. One thing to note is that there is a correspondence between the versions of Emscripten and Qt SDK. The -qt parameter setting is optional, usually xmake can detect the sdk path of qt. Xmake also supports Qt for wasm compilation, you only need: $ xmake f -p wasm Before switching this platform, we need to enter the Emscripten toolchain environment to ensure that emcc and other compilers are available. This platform is used to compile WebAssembly programs (emcc toolchain is used internally). 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. We can also specify to build Mac Catalyst programs. $ xmake f -p appletvos -appledev=simulator $ xmake f -p iphoneos -appledev=simulator Therefore, in version 2.6.5, we have added a new parameter to distinguish between emulator targets and emulator targets. ![]() Since the emulator on the m1 device also supports the arm64 architecture, it is no longer possible to distinguish the emulator from the arch alone. !> Please attempt to set -arch= option if it had failed to check compiler. The -bin option is used to set bin directory of toolchains. If you want to set the other android toolchains, you can use -bin option.įor example: $ 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 ![]() Linux $ xmake f -p linux Īndroid $ xmake f -p android -ndk=~/files/android-ndk-r10e/ !> Xmake will detect the current host platform automatically and build project. Xmake f -p linux or xmake config -plat=linux. You can use short or long command option, for example: If you want to known more options, please run: xmake f -help。 Set compilation configuration before building project with command xmake f|config. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |