Skip to content

Commit 427fd29

Browse files
committed
Build jnative
1 parent b4a5eea commit 427fd29

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ endif()
3737

3838
find_package(StandardMathLibrary REQUIRED)
3939
find_package(OpenMP)
40+
find_package(JNI)
4041

4142
set(TARGET_ARCHITECTURE "skylake" CACHE STRING "CPU architecture")
4243
OptimizeForArchitecture()

jsrc/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,3 +255,16 @@ file(GENERATE
255255
BINPATH_z_=: '${J_BINPATH}'
256256
0!:0<BINPATH,'${J_PROFILE_SCRIPT}'"
257257
)
258+
259+
if(JNI_FOUND)
260+
add_library(jnative)
261+
target_include_directories(jnative PRIVATE ${JNI_INCLUDE_DIRS})
262+
target_link_libraries(jnative PRIVATE ${JNI_LIBRARIES})
263+
target_sources(jnative PRIVATE
264+
andjnative.c
265+
jeload.h
266+
jeload.c
267+
com_jsoftware_j_JInterface.h
268+
../makemsvc/jnative/jnative.def
269+
)
270+
endif()

jsrc/andjnative.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "jeload.h"
33
#include "com_jsoftware_j_JInterface.h"
44
#include <stdint.h>
5-
#ifdef MMSC_VER
5+
#ifdef _MSC_VER
66
#pragma warning(disable: 4244)
77
#else
88
#include <strings.h>
@@ -283,7 +283,7 @@ JNIEXPORT void JNICALL Java_com_jsoftware_j_JInterface_JSetEnv
283283
LOGD("JSetEnv");
284284
const char* key = (*env)->GetStringUTFChars(env, jkey, 0);
285285
const char* val = (*env)->GetStringUTFChars(env, jval, 0);
286-
#ifdef MMSC_VER
286+
#ifdef _MSC_VER
287287
_putenv_s(key,val);
288288
#else
289289
setenv(key,val,0);

0 commit comments

Comments
 (0)