@@ -92,11 +92,14 @@ def copy_sources():
92
92
shutil .copytree (os .path .join (BUILD_DIR , "include" ), os .path .join (SRC_DIR , "include" ))
93
93
94
94
src .extend (glob .glob (os .path .join (BUILD_DIR , "*.[ch]" )))
95
+ src .extend (glob .glob (os .path .join (BUILD_DIR , "*.mk" )))
95
96
97
+ src .extend (glob .glob (os .path .join (BUILD_DIR , "Makefile" )))
96
98
src .extend (glob .glob (os .path .join (BUILD_DIR , "LICENSE*" )))
97
99
src .extend (glob .glob (os .path .join (BUILD_DIR , "README" )))
98
100
src .extend (glob .glob (os .path .join (BUILD_DIR , "*.TXT" )))
99
101
src .extend (glob .glob (os .path .join (BUILD_DIR , "RELEASE_NOTES" )))
102
+ src .extend (glob .glob (os .path .join (BUILD_DIR , "make.sh" )))
100
103
src .extend (glob .glob (os .path .join (BUILD_DIR , "CMakeLists.txt" )))
101
104
src .extend (glob .glob (os .path .join (BUILD_DIR , "pkgconfig.mk" )))
102
105
@@ -131,19 +134,22 @@ def build_libraries():
131
134
132
135
os .chdir (BUILD_DIR )
133
136
134
- # platform description refers at https://docs.python.org/2/library/sys.html#sys.platform
135
- # Use cmake for both Darwin and Windows since it can generate fat binaries
136
- # Windows build: this process requires few things:
137
- # - MSVC installed
138
- # - Run this command in an environment setup for MSVC
139
- if not os .path .exists ("build" ): os .mkdir ("build" )
140
- os .chdir ("build" )
141
- print ("Build Directory: {}\n " .format (os .getcwd ()))
142
- if SYSTEM == "win32" :
143
- os .system ('cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -G "NMake Makefiles" ..' )
144
- else :
145
- os .system ('cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -G "Unix Makefiles" ..' )
146
- os .system ("cmake --build ." )
137
+ # platform description refers at https://docs.python.org/3/library/sys.html#sys.platform
138
+ if SYSTEM == "win32" or SYSTEM == 'darwin' :
139
+ # Windows build: this process requires few things:
140
+ # - CMake + MSVC installed
141
+ # - Run this command in an environment setup for MSVC
142
+ if not os .path .exists ("build" ): os .mkdir ("build" )
143
+ os .chdir ("build" )
144
+ print ("Build Directory: {}\n " .format (os .getcwd ()))
145
+ # Only build capstone.dll / libcapstone.dylib
146
+ if SYSTEM == "win32" :
147
+ os .system ('cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -G "NMake Makefiles" ..' )
148
+ else :
149
+ os .system ('cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCAPSTONE_BUILD_TESTS=OFF -DCAPSTONE_BUILD_CSTOOL=OFF -G "Unix Makefiles" ..' )
150
+ os .system ("cmake --build ." )
151
+ else : # Unix incl. cygwin
152
+ os .system ("CAPSTONE_BUILD_CORE_ONLY=yes bash ./make.sh" )
147
153
148
154
shutil .copy (VERSIONED_LIBRARY_FILE , os .path .join (LIBS_DIR , LIBRARY_FILE ))
149
155
0 commit comments