allow to cross-compile 32 and 64 bit dlls using MinGW

This commit is contained in:
Christoph Gritschenberger 2017-01-26 15:11:12 +01:00
parent 45ff2ddf19
commit 4903258749
2 changed files with 16 additions and 1 deletions

View file

@ -26,7 +26,7 @@ ENDIF(WIN32)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
add_definitions("-DHAVE_CONFIG_H")
if(MINGW)
if(MINGW AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
# force MinGW-w64 in 32bit mode
add_definitions("-m32")
add_definitions("-DNOCRYPT")

View file

@ -35,6 +35,9 @@ If you are new to _libfreefare_ or the _nfc-tools_, you should collect useful in
| Mifare Application Directory (MAD) v3 | Supported (part of Mifare DESFire support) |
# Installation
## For *NIX systems
You can use released version (see **Download** section) or development version:
First, ensure all dependencies are installed:
@ -63,6 +66,18 @@ You can now compile **libfreefare** the usual autotools way:
make
sudo make install
```
## For Windows Systems
### Requirements
* cmake
* make
* mingw{32,64}-gcc
### Building
mingw64-cmake -DLIBNFC_INCLUDE_DIRS=/path/to/libnfc-source/include -DLIBNFC_LIBRARIES=/path/to/libnfc.dll
mingw64-make
# Debug
In order to debug using gdb, you should tune the CFLAGS: