blob: a8767dd667c5c6d86415fe74cab363f23b7bbabe [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.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080047
Nguyen Anh Quynh01f48392014-05-15 11:06:43 +080048 By default, Capstone use system dynamic memory management, and both DIET and X86_REDUCE
49 modes are disable.
Nguyen Anh Quynhba37f332014-05-14 07:48:50 +080050
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010051
52 For each option, refer to docs/README for more details.
53
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080054
55
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010056(1) Compile from source on Windows with Visual Studio
57
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080058 - Choose the configuration and the platform you want: Release/Debug & Win32/Win64.
59 - Build only the libraries, or the libraries along with all the tests.
60
61
Axel 0vercl0k Souchet27e9cc42014-05-10 14:41:45 +010062
Nguyen Anh Quynh726f99c2014-05-10 23:22:59 +080063(2) You can make sure the prior steps successfully worked by launching one of the
Nguyen Anh Quynh9c02b272014-05-14 08:00:22 +080064 testing binary (test*.exe).