blob: 3dbebd7798129573662f4ca939ceee276f63cfd0 [file] [log] [blame]
Nguyen Anh Quynh61882e52014-05-18 00:39:49 +08001How To compile Capstone on Windows using Microsoft Visual Studio.
2
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +01003 *-*-*-*-*-*
4
5Capstone requires no prerequisite packages, so it is easy to compile & install.
Nguyen Anh Quynh61882e52014-05-18 00:39:49 +08006Open the Visual Studio solution "msvc/capstone.sln" and follow the instructions
7below.
8
9NOTE: This requires Visual Studio 2010 or newer versions.
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010010
11
12(0) Tailor Capstone to your need.
13
14 Out of 7 archtitectures supported by Capstone (Arm, Arm64, Mips, PPC, Sparc,
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080015 SystemZ & X86), if you just need several selected archs, choose the ones you
16 want to compile in by opening Visual Studio solution "msvc\capstone.sln", then
17 directly editing the projects "capstone_static" & "capstone_dll" for static
18 and dynamic libraries, respectively. This must be done before going to the
19 next steps.
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010020
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080021 In VisualStudio interface, modify the preprocessor definitions via
22 "Project Properties" -> "Configuration Propertis" -> "C/C++" -> "Preprocessor"
23 to customize Capstone library, as followings.
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010024
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080025 - CAPSTONE_HAS_ARM: support ARM. Delete this to remove ARM support.
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080026 - CAPSTONE_HAS_ARM64: support ARM64. Delete this to remove ARM64 support.
27 - CAPSTONE_HAS_MIPS: support Mips. Delete this to remove Mips support.
28 - CAPSTONE_HAS_PPC: support PPC. Delete this to remove PPC support.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080029 - CAPSTONE_HAS_SPARC: support Sparc. Delete this to remove Sparc support.
30 - CAPSTONE_HAS_SYSZ: support SystemZ. Delete this to remove SystemZ support.
31 - CAPSTONE_HAS_X86: support X86. Delete this to remove X86 support.
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010032
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080033 By default, all 7 architectures are compiled in.
34
35
36 Besides, Capstone also allows some more customization via following macros.
37
38 - CAPSTONE_USE_SYS_DYN_MEM: delete this to use your own dynamic memory management.
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080039 - CAPSTONE_DIET_NO: rename this to "CAPSTONE_DIET" to make the binaries more compact.
40 - CAPSTONE_X86_REDUCE_NO: rename this to "CAPSTONE_X86_REDUCE" to make X86 binary smaller.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080041
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080042 By default, Capstone use system dynamic memory management, and both DIET and X86_REDUCE
43 modes are disable.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080044
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010045
46 For each option, refer to docs/README for more details.
47
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080048
49
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010050(1) Compile from source on Windows with Visual Studio
51
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080052 - Choose the configuration and the platform you want: Release/Debug & Win32/Win64.
53 - Build only the libraries, or the libraries along with all the tests.
54
55
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010056
Nguyen Anh Quynh726f99c2014-05-10 23:22:59 +080057(2) You can make sure the prior steps successfully worked by launching one of the
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080058 testing binary (test*.exe).