cleanup COMPILE-CMAKE.md
This commit is contained in:
@ -10,35 +10,7 @@ Requirements:
|
|||||||
Get CMake for free from http://www.cmake.org.
|
Get CMake for free from http://www.cmake.org.
|
||||||
|
|
||||||
|
|
||||||
[1] Tailor Unicorn to your need.
|
[1] To build Unicorn using Nmake of Windows SDK, do:
|
||||||
|
|
||||||
Out of archtitectures supported by Unicorn, if you just need several selected archs,
|
|
||||||
set the 'UNICORN_ARCH' in CMake. e.g.:
|
|
||||||
|
|
||||||
cmake -DUNICORN_ARCH="x86 mips" ..
|
|
||||||
|
|
||||||
By default, all architectures(x86 arm aarch64 m68k mips sparc) are compiled in.
|
|
||||||
|
|
||||||
Besides, Unicorn also allows some more customization via following macros.
|
|
||||||
|
|
||||||
- UNICORN_STATIC_MSVCRT: change this to OFF to use dynamic MSVCRT lib, Only on Windows.
|
|
||||||
|
|
||||||
[2] CMake allows you to generate different generators to build Unicorn. Below is
|
|
||||||
some examples on how to build Unicorn on Windows with CMake.
|
|
||||||
|
|
||||||
- You can let CMake select a generator for you. Do:
|
|
||||||
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
cmake ..
|
|
||||||
|
|
||||||
This last command is also where you can pass additional CMake configuration flags
|
|
||||||
using `-D<key>=<value>`. Then to build use:
|
|
||||||
|
|
||||||
cmake --build . --config Release
|
|
||||||
|
|
||||||
|
|
||||||
- To build Unicorn using Nmake of Windows SDK, do:
|
|
||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
@ -59,25 +31,26 @@ Get CMake for free from http://www.cmake.org.
|
|||||||
and build the solution including libraries & all test as usual.
|
and build the solution including libraries & all test as usual.
|
||||||
|
|
||||||
|
|
||||||
[3] You can make sure the prior steps successfully worked by launching one of the
|
[2] You can make sure the prior steps successfully worked by launching one of the
|
||||||
sample binary (sample_*.exe).
|
sample binary (sample_*.exe).
|
||||||
|
|
||||||
|
|
||||||
[4] You can also enable just one specific architecture by passing the architecture name
|
[3] You can also enable just one specific architecture by passing the architecture name
|
||||||
to either the cmake.sh or nmake.bat scripts. e.g.:
|
to either the cmake.sh or nmake.bat scripts. e.g.:
|
||||||
|
|
||||||
../cmake.sh x86
|
..\nmake.bat x86
|
||||||
|
|
||||||
Will just target the x86 architecture. The list of available architectures is:
|
Will just target the x86 architecture. The list of available architectures are:
|
||||||
X86 ARM AARCH64 M68K MIPS SPARC.
|
X86 ARM AARCH64 M68K MIPS SPARC.
|
||||||
|
|
||||||
|
|
||||||
[5] You can also create an installation image with cmake, by using the 'install' target.
|
[4] You can also create an installation image with cmake, by using the 'install' target.
|
||||||
Use:
|
Use:
|
||||||
|
|
||||||
cmake --build . --config Release --target install
|
cmake --build . --config Release --target install
|
||||||
|
|
||||||
This will normally install an image in a default location (NOT SUPPORT Windows),
|
This will normally install an image in a default location (on MacOS and Linux, but this is not supported
|
||||||
so it's good to explicitly set this location when configuring CMake. Use: `-DCMAKE_INSTALL_PREFIX=image`
|
on Windows). So in case you want to change the install location, set this when configuring CMake.
|
||||||
for instance, to put the installation in the 'image' subdirectory of the build directory.
|
Use: `-DCMAKE_INSTALL_PREFIX=path` for instance, to put the installation in the 'path' subdirectory of
|
||||||
Default value of 'CMAKE_INSTALL_PREFIX' on *nix is '/usr/local'.
|
the build directory.
|
||||||
|
The default value of 'CMAKE_INSTALL_PREFIX' on *nix is '/usr/local'.
|
||||||
|
Reference in New Issue
Block a user