blob: c872394af8300fa4fa2a5863bd0b38ad01a0c9b7 [file] [log] [blame]
Nguyen Anh Quynh6f9b1132014-05-19 17:06:44 +08001This documentation explains how to compile Capstone on Windows using
2Microsoft Visual Studio version 2010 or newer.
Nguyen Anh Quynh61882e52014-05-18 00:39:49 +08003
Nguyen Anh Quynhf1c3acb2014-05-28 22:39:23 +08004To compile Capstone on *nix, see COMPILE.TXT
5
6To compile Capstone with CMake, see COMPILE_CMAKE.TXT
7
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +01008 *-*-*-*-*-*
9
10Capstone requires no prerequisite packages, so it is easy to compile & install.
Nguyen Anh Quynh61882e52014-05-18 00:39:49 +080011Open the Visual Studio solution "msvc/capstone.sln" and follow the instructions
12below.
13
14NOTE: This requires Visual Studio 2010 or newer versions.
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010015
16
17(0) Tailor Capstone to your need.
18
Nguyen Anh Quynhc80d8402014-05-26 23:02:48 +080019 Out of 8 archtitectures supported by Capstone (Arm, Arm64, Mips, PPC, Sparc,
20 SystemZ, X86 & XCore), if you just need several selected archs, choose the ones
21 you want to compile in by opening Visual Studio solution "msvc\capstone.sln",
22 then directly editing the projects "capstone_static" & "capstone_dll" for static
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080023 and dynamic libraries, respectively. This must be done before going to the
24 next steps.
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010025
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080026 In VisualStudio interface, modify the preprocessor definitions via
27 "Project Properties" -> "Configuration Propertis" -> "C/C++" -> "Preprocessor"
28 to customize Capstone library, as followings.
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010029
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080030 - CAPSTONE_HAS_ARM: support ARM. Delete this to remove ARM support.
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080031 - CAPSTONE_HAS_ARM64: support ARM64. Delete this to remove ARM64 support.
32 - CAPSTONE_HAS_MIPS: support Mips. Delete this to remove Mips support.
33 - CAPSTONE_HAS_PPC: support PPC. Delete this to remove PPC support.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080034 - CAPSTONE_HAS_SPARC: support Sparc. Delete this to remove Sparc support.
35 - CAPSTONE_HAS_SYSZ: support SystemZ. Delete this to remove SystemZ support.
36 - CAPSTONE_HAS_X86: support X86. Delete this to remove X86 support.
Nguyen Anh Quynhc80d8402014-05-26 23:02:48 +080037 - CAPSTONE_HAS_XCORE: support XCore. Delete this to remove XCore support.
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010038
Nguyen Anh Quynhc80d8402014-05-26 23:02:48 +080039 By default, all 8 architectures are compiled in.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080040
41
42 Besides, Capstone also allows some more customization via following macros.
43
44 - CAPSTONE_USE_SYS_DYN_MEM: delete this to use your own dynamic memory management.
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080045 - CAPSTONE_DIET_NO: rename this to "CAPSTONE_DIET" to make the binaries more compact.
46 - CAPSTONE_X86_REDUCE_NO: rename this to "CAPSTONE_X86_REDUCE" to make X86 binary smaller.
obscb8e40c2014-08-17 21:07:13 +020047 - CAPSTONE_X86_ATT_DISABLE_NO: rename this to "CAPSTONE_X86_ATT_DISABLE" to disable
48 AT&T syntax on x86.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080049
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080050 By default, Capstone use system dynamic memory management, and both DIET and X86_REDUCE
51 modes are disable.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080052
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010053
54 For each option, refer to docs/README for more details.
55
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080056
57
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010058(1) Compile from source on Windows with Visual Studio
59
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080060 - Choose the configuration and the platform you want: Release/Debug & Win32/Win64.
61 - Build only the libraries, or the libraries along with all the tests.
62
63
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010064
Nguyen Anh Quynh726f99c2014-05-10 23:22:59 +080065(2) You can make sure the prior steps successfully worked by launching one of the
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080066 testing binary (test*.exe).