Add support for building with clang-cl
This commit is contained in:
7
README
7
README
@@ -146,12 +146,17 @@ It's also possible to build libffi on Windows platforms with
|
|||||||
Microsoft's Visual C++ compiler. In this case, use the msvcc.sh
|
Microsoft's Visual C++ compiler. In this case, use the msvcc.sh
|
||||||
wrapper script during configuration like so:
|
wrapper script during configuration like so:
|
||||||
|
|
||||||
path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\"
|
path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP"
|
||||||
|
|
||||||
For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and
|
For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and
|
||||||
CXX="path/to/msvcc.sh -m64". You may also need to specify --build
|
CXX="path/to/msvcc.sh -m64". You may also need to specify --build
|
||||||
appropriately.
|
appropriately.
|
||||||
|
|
||||||
|
It is also possible to build libffi on Windows platforms with the LLVM
|
||||||
|
project's clang-cl compiler, like below:
|
||||||
|
|
||||||
|
path/to/configure CC="path/to/msvcc.sh -clang-cl" CXX="path/to/msvcc.sh -clang-cl" LD=link CPP="clang-cl -EP"
|
||||||
|
|
||||||
When building with MSVC under a MingW environment, you may need to
|
When building with MSVC under a MingW environment, you may need to
|
||||||
remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
|
remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
|
||||||
command. ('cygpath' is not present in MingW, and is not required when
|
command. ('cygpath' is not present in MingW, and is not required when
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ extern "C" {
|
|||||||
|
|
||||||
#ifndef LIBFFI_ASM
|
#ifndef LIBFFI_ASM
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
#define __attribute__(X)
|
#define __attribute__(X)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
6
msvcc.sh
6
msvcc.sh
@@ -63,11 +63,15 @@ do
|
|||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
-m64)
|
-m64)
|
||||||
cl="cl" # "$MSVC/x86_amd64/cl"
|
|
||||||
ml="ml64" # "$MSVC/x86_amd64/ml64"
|
ml="ml64" # "$MSVC/x86_amd64/ml64"
|
||||||
safeseh=
|
safeseh=
|
||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
|
-clang-cl)
|
||||||
|
cl="clang-cl"
|
||||||
|
safeseh=
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
-O0)
|
-O0)
|
||||||
args="$args -Od"
|
args="$args -Od"
|
||||||
shift 1
|
shift 1
|
||||||
|
|||||||
Reference in New Issue
Block a user