Skip to content
Snippets Groups Projects
Commit 0faa856b authored by Nguyen Anh Quynh's avatar Nguyen Anh Quynh
Browse files

make-*sh now can build MacOS universal binaries

parent 7dc48f50
Branches
Tags
No related merge requests found
......@@ -22,6 +22,11 @@ For Windows, see [COMPILE-WINDOWS.md](COMPILE-WINDOWS.md)
$ cd build
$ ../make-share.sh
On Mac OS, to build universal binaries including both 32-bit & 64-bit code,
replace the last line with:
$ ../make-share.sh macos-universal
In the case you want to compile with all the debug information, replace the
last line with:
......@@ -41,6 +46,11 @@ For Windows, see [COMPILE-WINDOWS.md](COMPILE-WINDOWS.md)
$ cd build
$ ../make-lib.sh
On Mac OS, to build universal binaries including both 32-bit & 64-bit code,
replace the last line with:
$ ../make-lib.sh macos-universal
In the case you want to compile with all the debug information, replace the
last line with:
......
#!/bin/sh -ex
# Run this with "debug" option to compile Keystone with debug info
if [ -n "$1" ]
then
# compile with DEBUG option
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..
else
# default compile
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..
fi
#!/bin/sh -e
time make -j8
# Build static library of Keystone Engine
# syntax: make-lib.sh [debug] [macos-universal]
function usage()
{
echo ""
echo "Syntax: make-lib.sh [debug] [macos-universal]"
echo "\tdebug: build with debug info"
echo "\tmacos-universal: build MacOS universal binaries"
echo ""
}
BUILDTYPE='Release'
MACOS_UNIVERSAL=''
ARCH=''
while [ "$1" != "" ]; do
case $1 in
debug)
BUILDTYPE='Debug'
;;
macos-universal)
ARCH='i386;x86_64'
;;
*)
echo "ERROR: unknown parameter \"$1\""
usage
exit 1
;;
esac
shift
done
cmake -DCMAKE_OSX_ARCHITECTURES="$ARCH" -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=OFF -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..
time make -j8
#!/bin/sh -xe
# Run this with "debug" option to compile Keystone with debug info
if [ -n "$1" ]
then
# compile with DEBUG option
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..
else
# default compile
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..
fi
#!/bin/sh -e
# Build shared library of Keystone Engine
# syntax: make-share.sh [debug] [macos-universal]
function usage()
{
echo ""
echo "Syntax: make-share.sh [debug] [macos-universal]"
echo "\tdebug: build with debug info"
echo "\tmacos-universal: build MacOS universal binaries"
echo ""
}
BUILDTYPE='Release'
MACOS_UNIVERSAL=''
ARCH=''
while [ "$1" != "" ]; do
case $1 in
debug)
BUILDTYPE='Debug'
;;
macos-universal)
ARCH='i386;x86_64'
;;
*)
echo "ERROR: unknown parameter \"$1\""
usage
exit 1
;;
esac
shift
done
cmake -DCMAKE_OSX_ARCHITECTURES="$ARCH" -DCMAKE_BUILD_TYPE=$BUILDTYPE -DBUILD_SHARED_LIBS=ON -DLLVM_TARGETS_TO_BUILD="all" -G "Unix Makefiles" ..
time make -j8
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment