Skip to content

Commit adb916e

Browse files
authored
Merge pull request #675 from matthiasblaesing/static_build_windows
Staticly link the windows jnidispatch.dll when build with MSVC compiler
2 parents 6a288ba + 058f12a commit adb916e

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Bug Fixes
7272
* [#633](https://github.com/java-native-access/jna/pull/633): Restore default usage of platform native encoding for Java strings passed to native functions (was hard-coded to UTF-8 in 4.0 and later) [@amake](https://github.com/amake)
7373
* [#634](https://github.com/java-native-access/jna/pull/634): Improve BSTR handling and add `SysStringByteLen` and `SysStringLen` to `com.sun.jna.platform.win32.OleAuto` - [@matthiasblaesing](https://github.com/matthiasblaesing).
7474
* [#646](https://github.com/java-native-access/jna/issues/646): `platform.win32.COM.COMBindingBaseObject` swallows reason if instantiation fails - [@matthiasblaesing](https://github.com/matthiasblaesing).
75+
* [#636](https://github.com/java-native-access/jna/issues/636); Staticly link visual c++ runtime when building with MSVC - [@matthiasblaesing](https://github.com/matthiasblaesing).
7576

7677
Release 4.2.1
7778
=============

lib/native/win32-x86-64.jar

34.5 KB
Binary file not shown.

lib/native/win32-x86.jar

31.7 KB
Binary file not shown.

native/Makefile

+9-4
Original file line numberDiff line numberDiff line change
@@ -207,19 +207,24 @@ STRIP=@echo
207207
LIBPFX=
208208
LIBSFX=.dll
209209
TESTLIB_TRUNC=$(BUILD)/testlib-truncated.dll
210+
210211
ifeq ($(ARCH),amd64)
211212
MINGW_PREFIX?=x86_64-w64-mingw32-
212213
FFI_CONFIG+=--host=x86_64-w64-mingw32
213-
# Need windres from mingw distribution, even if building with MSVC
214-
WINDRES=$(MINGW_PREFIX)windres
215-
MINGW=$(MINGW_PREFIX)gcc
216214
else
217-
MINGW_PREFIX?=i686-pc-mingw32-
215+
FFI_CONFIG+=--host=i686-w64-mingw32
216+
MINGW_PREFIX?=i686-w64-mingw32-
218217
endif
218+
# Need windres from mingw distribution, even if building with MSVC
219+
WINDRES=$(MINGW_PREFIX)windres
220+
MINGW=$(MINGW_PREFIX)gcc
219221

220222
ifeq ($(USE_MSVC),true)
221223
# MS compiler
222224
CC=$(FFI_SRC)/msvcc.sh
225+
ifneq ($(DYNAMIC_LIBFFI),true)
226+
CDEFINES+=-DUSE_STATIC_RTL
227+
endif
223228
COPT=
224229
CPP=cl -nologo -EP
225230
LD=link

0 commit comments

Comments
 (0)