You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by iv...@apache.org on 2021/11/02 13:39:17 UTC
[ignite] branch ignite-2.12 updated: IGNITE-15637 CPP: Remove
separate JNI module and move it to Core - Fixes #9521.
This is an automated email from the ASF dual-hosted git repository.
ivandasch pushed a commit to branch ignite-2.12
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/ignite-2.12 by this push:
new f6f8477 IGNITE-15637 CPP: Remove separate JNI module and move it to Core - Fixes #9521.
f6f8477 is described below
commit f6f84779cbce6980261809cec914b9916dbd417b
Author: Ivan Daschinsky <iv...@apache.org>
AuthorDate: Tue Nov 2 15:40:49 2021 +0300
IGNITE-15637 CPP: Remove separate JNI module and move it to Core - Fixes #9521.
Signed-off-by: Ivan Daschinsky <iv...@apache.org>
(cherry picked from commit 1be3b2e78fea43a93a317435a369e28d7a883200)
---
assembly/release-apache-ignite-base.xml | 6 --
modules/platforms/cpp/CMakeLists.txt | 1 -
modules/platforms/cpp/README.txt | 3 +-
modules/platforms/cpp/binary/CMakeLists.txt | 12 +--
modules/platforms/cpp/cmake/FindIgnite.cmake | 24 ++---
modules/platforms/cpp/cmake/FindODBC.cmake | 14 +--
modules/platforms/cpp/common/CMakeLists.txt | 12 +--
.../platforms/cpp/core-test/src/affinity_test.cpp | 2 +-
modules/platforms/cpp/core/CMakeLists.txt | 27 +++--
.../cpp/{jni => core}/include/ignite/jni/java.h | 2 +-
.../cpp/{jni => core}/include/ignite/jni/utils.h | 39 +++----
modules/platforms/cpp/core/src/ignition.cpp | 2 -
.../cpp/core/src/impl/ignite_environment.cpp | 2 +-
.../cpp/{jni/src => core/src/jni}/java.cpp | 2 +-
.../linux/src => core/src/jni/os/linux}/utils.cpp | 4 +-
.../os/win/src => core/src/jni/os/win}/utils.cpp | 0
.../cpp/examples/compute-example/CMakeLists.txt | 3 +-
.../continuous-query-example/CMakeLists.txt | 3 +-
.../cpp/examples/odbc-example/CMakeLists.txt | 4 +-
.../cpp/examples/put-get-example/CMakeLists.txt | 3 +-
.../cpp/examples/query-example/CMakeLists.txt | 3 +-
.../thin-client-put-get-example/CMakeLists.txt | 3 +-
modules/platforms/cpp/jni/CMakeLists.txt | 56 ----------
.../platforms/cpp/jni/include/ignite/jni/exports.h | 59 -----------
modules/platforms/cpp/jni/src/exports.cpp | 116 ---------------------
modules/platforms/cpp/network/CMakeLists.txt | 12 +--
modules/platforms/cpp/odbc-test/README.TXT | 1 -
modules/platforms/cpp/odbc/CMakeLists.txt | 6 +-
modules/platforms/cpp/thin-client/CMakeLists.txt | 8 +-
29 files changed, 98 insertions(+), 331 deletions(-)
diff --git a/assembly/release-apache-ignite-base.xml b/assembly/release-apache-ignite-base.xml
index 5632825..e3b69e8 100644
--- a/assembly/release-apache-ignite-base.xml
+++ b/assembly/release-apache-ignite-base.xml
@@ -112,12 +112,6 @@
<outputDirectory>/platforms/cpp/network</outputDirectory>
</fileSet>
- <!-- Move CPP "jni" module. -->
- <fileSet>
- <directory>modules/platforms/cpp/jni</directory>
- <outputDirectory>/platforms/cpp/jni</outputDirectory>
- </fileSet>
-
<!-- Move CPP "core" module. -->
<fileSet>
<directory>modules/platforms/cpp/core</directory>
diff --git a/modules/platforms/cpp/CMakeLists.txt b/modules/platforms/cpp/CMakeLists.txt
index ced0945..95b6082 100644
--- a/modules/platforms/cpp/CMakeLists.txt
+++ b/modules/platforms/cpp/CMakeLists.txt
@@ -73,7 +73,6 @@ add_subdirectory(common)
add_subdirectory(binary)
if (${WITH_CORE} OR ${WITH_TESTS})
- add_subdirectory(jni)
add_subdirectory(core)
add_subdirectory(ignite)
endif()
diff --git a/modules/platforms/cpp/README.txt b/modules/platforms/cpp/README.txt
index 0411b70..e90daa4 100644
--- a/modules/platforms/cpp/README.txt
+++ b/modules/platforms/cpp/README.txt
@@ -76,11 +76,10 @@ Development:
* Update Linker\Input\Additional Dependencies in Project Properties with path to
* ignite.common.lib
* ignite.binary.lib
- * ignite.jni.lib to use thick client
* ignite.core.lib to use thick client
* ignite.network.lib to use thin client
* ignite.thin-client.lib to use thin client
- * Make sure that your application is aware about ignite.jni.dll and ignite.core.dll or
+ * Make sure that your application is aware about ignite.core.dll or
ignite.thin-client.dll libraries. The easiest way to achieve this is to either make
sure these files are in %PATH%, or to put them into the output directory of your
project with help of PostBuild events.
diff --git a/modules/platforms/cpp/binary/CMakeLists.txt b/modules/platforms/cpp/binary/CMakeLists.txt
index 59d3d46..dc4e6c2 100644
--- a/modules/platforms/cpp/binary/CMakeLists.txt
+++ b/modules/platforms/cpp/binary/CMakeLists.txt
@@ -50,8 +50,8 @@ if (WIN32)
add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-objlib>)
list(APPEND _target_libs ${TARGET}-objlib)
-
- set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.binary")
+
+ set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.binary")
else()
add_library(${TARGET} SHARED ${SOURCES})
endif()
@@ -71,9 +71,9 @@ foreach(_target_lib IN LISTS _target_libs)
endforeach()
unset(_target_libs)
-install(TARGETS ${TARGET}
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
+install(TARGETS ${TARGET}
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h*")
diff --git a/modules/platforms/cpp/cmake/FindIgnite.cmake b/modules/platforms/cpp/cmake/FindIgnite.cmake
index a5705e0..6fc7acb 100644
--- a/modules/platforms/cpp/cmake/FindIgnite.cmake
+++ b/modules/platforms/cpp/cmake/FindIgnite.cmake
@@ -20,29 +20,25 @@ find_path(IGNITE_INCLUDE_DIR ignite/ignite.h
PATH_SUFFIXES ignite)
if (WIN32)
- find_library(IGNITE_LIB ignite.core HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_LIB ignite.core HINTS ${IGNITE_CPP_DIR}/lib)
- find_library(IGNITE_COMMON_LIB ignite.common HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_COMMON_LIB ignite.common HINTS ${IGNITE_CPP_DIR}/lib)
- find_library(IGNITE_NETWORK_LIB ignite.network HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_NETWORK_LIB ignite.network HINTS ${IGNITE_CPP_DIR}/lib)
- find_library(IGNITE_JNI_LIB ignite.jni HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_THIN_CLIENT_LIB ignite.thin-client HINTS ${IGNITE_CPP_DIR}/lib)
- find_library(IGNITE_THIN_CLIENT_LIB ignite.thin-client HINTS ${IGNITE_CPP_DIR}/lib)
-
- find_library(IGNITE_BINARY_LIB ignite.binary HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_BINARY_LIB ignite.binary HINTS ${IGNITE_CPP_DIR}/lib)
else()
- find_library(IGNITE_LIB ignite HINTS ${IGNITE_CPP_DIR}/lib)
-
- find_library(IGNITE_COMMON_LIB ignite-common HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_LIB ignite HINTS ${IGNITE_CPP_DIR}/lib)
- find_library(IGNITE_NETWORK_LIB ignite-network HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_COMMON_LIB ignite-common HINTS ${IGNITE_CPP_DIR}/lib)
- find_library(IGNITE_JNI_LIB ignite-jni HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_NETWORK_LIB ignite-network HINTS ${IGNITE_CPP_DIR}/lib)
- find_library(IGNITE_THIN_CLIENT_LIB ignite-thin-client HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_THIN_CLIENT_LIB ignite-thin-client HINTS ${IGNITE_CPP_DIR}/lib)
- find_library(IGNITE_BINARY_LIB ignite-binary HINTS ${IGNITE_CPP_DIR}/lib)
+ find_library(IGNITE_BINARY_LIB ignite-binary HINTS ${IGNITE_CPP_DIR}/lib)
endif()
include(FindPackageHandleStandardArgs)
diff --git a/modules/platforms/cpp/cmake/FindODBC.cmake b/modules/platforms/cpp/cmake/FindODBC.cmake
index 4886cc0..b730f25 100644
--- a/modules/platforms/cpp/cmake/FindODBC.cmake
+++ b/modules/platforms/cpp/cmake/FindODBC.cmake
@@ -9,14 +9,14 @@ set(_odbc_required_libs_names)
### Try Windows Kits ##########################################################
if(WIN32)
- # List names of ODBC libraries on Windows
- if(NOT MINGW)
- set(ODBC_LIBRARY odbc32.lib)
- else()
- set(ODBC_LIBRARY libodbc32.a)
- endif()
+ # List names of ODBC libraries on Windows
+ if(NOT MINGW)
+ set(ODBC_LIBRARY odbc32.lib)
+ else()
+ set(ODBC_LIBRARY libodbc32.a)
+ endif()
- set(_odbc_lib_names odbc32;)
+ set(_odbc_lib_names odbc32;)
# List additional libraries required to use ODBC library
if(MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
diff --git a/modules/platforms/cpp/common/CMakeLists.txt b/modules/platforms/cpp/common/CMakeLists.txt
index ef1bbe3..5469dd6 100644
--- a/modules/platforms/cpp/common/CMakeLists.txt
+++ b/modules/platforms/cpp/common/CMakeLists.txt
@@ -54,8 +54,8 @@ if (WIN32)
add_library(${TARGET}-objlib OBJECT ${SOURCES})
add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-objlib>)
-
- set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.common")
+
+ set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.common")
list(APPEND _target_libs ${TARGET}-objlib)
else()
@@ -79,9 +79,9 @@ foreach(_target_lib IN LISTS _target_libs)
endforeach()
unset(_target_libs)
-install(TARGETS ${TARGET}
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
+install(TARGETS ${TARGET}
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
)
install(DIRECTORY include/ ${OS_INCLUDE}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h*")
diff --git a/modules/platforms/cpp/core-test/src/affinity_test.cpp b/modules/platforms/cpp/core-test/src/affinity_test.cpp
index 8de7962..b5fe08b 100644
--- a/modules/platforms/cpp/core-test/src/affinity_test.cpp
+++ b/modules/platforms/cpp/core-test/src/affinity_test.cpp
@@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(IgniteAffinityMapKeysToNodes)
std::vector<int32_t> keys;
- keys.reserve(10000);
+ keys.reserve(10000);
for (int i = 1; i < 10000; i++)
keys.push_back(i);
diff --git a/modules/platforms/cpp/core/CMakeLists.txt b/modules/platforms/cpp/core/CMakeLists.txt
index 429e95b..b4c8e5b 100644
--- a/modules/platforms/cpp/core/CMakeLists.txt
+++ b/modules/platforms/cpp/core/CMakeLists.txt
@@ -17,12 +17,15 @@
project(ignite)
+find_library(JVM_LIBRARY jvm ${JAVA_JVM_LIBRARY_DIRECTORIES})
+
include_directories(SYSTEM ${JNI_INCLUDE_DIRS})
include_directories(include)
set(TARGET ${PROJECT_NAME})
set(SOURCES src/ignite.cpp
+ src/jni/java.cpp
src/ignition.cpp
src/impl/ignite_environment.cpp
src/impl/binary/binary_type_updater_impl.cpp
@@ -37,7 +40,7 @@ set(SOURCES src/ignite.cpp
src/impl/transactions/transactions_impl.cpp
src/impl/cluster/cluster_group_impl.cpp
src/impl/compute/cancelable_impl.cpp
- src/impl/compute/compute_impl.cpp
+ src/impl/compute/compute_impl.cpp
src/impl/ignite_impl.cpp
src/impl/ignite_binding_impl.cpp
src/transactions/transaction.cpp
@@ -49,21 +52,31 @@ set(SOURCES src/ignite.cpp
src/impl/cluster/cluster_node_impl.cpp
src/impl/cache/cache_affinity_impl.cpp)
+if (WIN32)
+ list(APPEND SOURCES src/jni/os/win/utils.cpp)
+else()
+ list(APPEND SOURCES src/jni/os/linux/utils.cpp)
+endif()
+
add_library(${TARGET} SHARED ${SOURCES})
set_target_properties(${TARGET} PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
+target_link_libraries(${TARGET} ignite-binary ${JVM_LIBRARY})
+
if (WIN32)
- set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.core")
-endif()
+ target_link_libraries(${TARGET} delayimp)
-target_link_libraries(${TARGET} ignite-binary ignite-jni)
+ set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/DELAYLOAD:jvm.dll")
+
+ set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.core")
+endif()
target_include_directories(${TARGET} INTERFACE include)
install(TARGETS ${TARGET}
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h*")
diff --git a/modules/platforms/cpp/jni/include/ignite/jni/java.h b/modules/platforms/cpp/core/include/ignite/jni/java.h
similarity index 99%
rename from modules/platforms/cpp/jni/include/ignite/jni/java.h
rename to modules/platforms/cpp/core/include/ignite/jni/java.h
index ec98dc6..0e2a418 100644
--- a/modules/platforms/cpp/jni/include/ignite/jni/java.h
+++ b/modules/platforms/cpp/core/include/ignite/jni/java.h
@@ -22,7 +22,7 @@
#include <jni.h>
-#include "ignite/common/common.h"
+#include <ignite/common/common.h>
namespace ignite
{
diff --git a/modules/platforms/cpp/jni/include/ignite/jni/utils.h b/modules/platforms/cpp/core/include/ignite/jni/utils.h
similarity index 85%
rename from modules/platforms/cpp/jni/include/ignite/jni/utils.h
rename to modules/platforms/cpp/core/include/ignite/jni/utils.h
index 7b1e62a..67c1bf1 100644
--- a/modules/platforms/cpp/jni/include/ignite/jni/utils.h
+++ b/modules/platforms/cpp/core/include/ignite/jni/utils.h
@@ -19,8 +19,9 @@
#include <string>
-#include <ignite/jni/java.h>
#include <ignite/common/common.h>
+#include <ignite/common/concurrent.h>
+#include <ignite/jni/java.h>
namespace ignite
{
@@ -53,8 +54,7 @@ namespace ignite
* Default constructor
*/
JavaGlobalRef() :
- ctx(0),
- obj(0)
+ obj(NULL)
{
// No-op.
}
@@ -65,11 +65,10 @@ namespace ignite
* @param ctx JNI context.
* @param obj Java object.
*/
- JavaGlobalRef(java::JniContext& ctx, jobject obj) :
- ctx(&ctx),
- obj(ctx.Acquire(obj))
+ JavaGlobalRef(common::concurrent::SharedPointer<java::JniContext>& ctx, jobject obj)
+ : obj(NULL)
{
- // No-op.
+ Init(ctx, obj);
}
/**
@@ -77,11 +76,10 @@ namespace ignite
*
* @param other Other instance.
*/
- JavaGlobalRef(const JavaGlobalRef& other) :
- ctx(other.ctx),
- obj(ctx->Acquire(other.obj))
+ JavaGlobalRef(const JavaGlobalRef& other)
+ : obj(NULL)
{
- // No-op.
+ Init(other.ctx, other.obj);
}
/**
@@ -94,11 +92,9 @@ namespace ignite
{
if (this != &other)
{
- if (ctx)
- ctx->Release(obj);
+ java::JniContext::Release(obj);
- ctx = other.ctx;
- obj = ctx->Acquire(other.obj);
+ Init(other.ctx, other.obj);
}
return *this;
@@ -109,8 +105,7 @@ namespace ignite
*/
~JavaGlobalRef()
{
- if (ctx)
- ctx->Release(obj);
+ java::JniContext::Release(obj);
}
/**
@@ -124,8 +119,16 @@ namespace ignite
}
private:
+ /** Initializer */
+ void Init(const common::concurrent::SharedPointer<java::JniContext>& ctx0, jobject obj0) {
+ ctx = ctx0;
+
+ if (ctx.IsValid())
+ this->obj = ctx.Get()->Acquire(obj0);
+ }
+
/** Context. */
- java::JniContext* ctx;
+ common::concurrent::SharedPointer<java::JniContext> ctx;
/** Object. */
jobject obj;
diff --git a/modules/platforms/cpp/core/src/ignition.cpp b/modules/platforms/cpp/core/src/ignition.cpp
index 004d8b8..8aa7eaa 100644
--- a/modules/platforms/cpp/core/src/ignition.cpp
+++ b/modules/platforms/cpp/core/src/ignition.cpp
@@ -18,9 +18,7 @@
#include <sstream>
#include <memory>
-#include <ignite/common/common.h>
#include <ignite/common/concurrent.h>
-#include <ignite/jni/exports.h>
#include <ignite/jni/java.h>
#include <ignite/jni/utils.h>
#include <ignite/common/utils.h>
diff --git a/modules/platforms/cpp/core/src/impl/ignite_environment.cpp b/modules/platforms/cpp/core/src/impl/ignite_environment.cpp
index 894add5..4c84f16 100644
--- a/modules/platforms/cpp/core/src/impl/ignite_environment.cpp
+++ b/modules/platforms/cpp/core/src/impl/ignite_environment.cpp
@@ -743,7 +743,7 @@ namespace ignite
void IgniteEnvironment::OnStartCallback(int64_t memPtr, jobject proc)
{
- this->proc = jni::JavaGlobalRef(*ctx.Get(), proc);
+ this->proc = jni::JavaGlobalRef(ctx, proc);
InteropExternalMemory mem(reinterpret_cast<int8_t*>(memPtr));
InteropInputStream stream(&mem);
diff --git a/modules/platforms/cpp/jni/src/java.cpp b/modules/platforms/cpp/core/src/jni/java.cpp
similarity index 99%
rename from modules/platforms/cpp/jni/src/java.cpp
rename to modules/platforms/cpp/core/src/jni/java.cpp
index c434f25..171fc90 100644
--- a/modules/platforms/cpp/jni/src/java.cpp
+++ b/modules/platforms/cpp/core/src/jni/java.cpp
@@ -827,7 +827,7 @@ namespace ignite
ExceptionCheck(env, err);
}
- jobject JniContext::TargetInStreamOutObject(jobject obj, int opType, int64_t memPtr, JniErrorInfo* err) {
+ jobject JniContext::TargetInStreamOutObject(jobject obj, int opType, int64_t memPtr, JniErrorInfo* err) {
JNIEnv* env = Attach();
jobject res = env->CallObjectMethod(obj, jvm->GetMembers().m_PlatformTarget_inStreamOutObject, opType, memPtr);
diff --git a/modules/platforms/cpp/jni/os/linux/src/utils.cpp b/modules/platforms/cpp/core/src/jni/os/linux/utils.cpp
similarity index 99%
rename from modules/platforms/cpp/jni/os/linux/src/utils.cpp
rename to modules/platforms/cpp/core/src/jni/os/linux/utils.cpp
index 64b532f..dab7849 100644
--- a/modules/platforms/cpp/jni/os/linux/src/utils.cpp
+++ b/modules/platforms/cpp/core/src/jni/os/linux/utils.cpp
@@ -64,7 +64,7 @@ namespace ignite
{
pthread_key_create(&attachKey, DestroyAttachKey);
}
-
+
AttachHelper::~AttachHelper()
{
JniContext::Detach();
@@ -449,7 +449,7 @@ namespace ignite
char* res = getcwd(curDir.GetData(), curDir.GetSize());
if (!res)
- return std::string();
+ return std::string();
std::string curDirStr(curDir.GetData());
diff --git a/modules/platforms/cpp/jni/os/win/src/utils.cpp b/modules/platforms/cpp/core/src/jni/os/win/utils.cpp
similarity index 100%
rename from modules/platforms/cpp/jni/os/win/src/utils.cpp
rename to modules/platforms/cpp/core/src/jni/os/win/utils.cpp
diff --git a/modules/platforms/cpp/examples/compute-example/CMakeLists.txt b/modules/platforms/cpp/examples/compute-example/CMakeLists.txt
index e336d96..a969f9c 100644
--- a/modules/platforms/cpp/examples/compute-example/CMakeLists.txt
+++ b/modules/platforms/cpp/examples/compute-example/CMakeLists.txt
@@ -29,5 +29,4 @@ include_directories(../include)
add_executable(${TARGET} src/compute_example.cpp)
-target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_JNI_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB}
- ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB} ${CMAKE_THREAD_LIBS_INIT})
diff --git a/modules/platforms/cpp/examples/continuous-query-example/CMakeLists.txt b/modules/platforms/cpp/examples/continuous-query-example/CMakeLists.txt
index a5c8f97..c907f1d 100644
--- a/modules/platforms/cpp/examples/continuous-query-example/CMakeLists.txt
+++ b/modules/platforms/cpp/examples/continuous-query-example/CMakeLists.txt
@@ -29,5 +29,4 @@ include_directories(../include)
add_executable(${TARGET} src/continuous_query_example.cpp)
-target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_JNI_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB}
- ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB} ${CMAKE_THREAD_LIBS_INIT})
diff --git a/modules/platforms/cpp/examples/odbc-example/CMakeLists.txt b/modules/platforms/cpp/examples/odbc-example/CMakeLists.txt
index 3a11e8e..a0d0f07 100644
--- a/modules/platforms/cpp/examples/odbc-example/CMakeLists.txt
+++ b/modules/platforms/cpp/examples/odbc-example/CMakeLists.txt
@@ -34,5 +34,5 @@ if (WIN32)
remove_definitions(-DUNICODE=1)
endif()
-target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_JNI_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB}
- ${ODBC_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB} ${ODBC_LIBRARY}
+ ${CMAKE_THREAD_LIBS_INIT})
diff --git a/modules/platforms/cpp/examples/put-get-example/CMakeLists.txt b/modules/platforms/cpp/examples/put-get-example/CMakeLists.txt
index e5463a3..c30592f99 100644
--- a/modules/platforms/cpp/examples/put-get-example/CMakeLists.txt
+++ b/modules/platforms/cpp/examples/put-get-example/CMakeLists.txt
@@ -29,5 +29,4 @@ include_directories(../include)
add_executable(${TARGET} src/put_get_example.cpp)
-target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_JNI_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB}
- ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB} ${CMAKE_THREAD_LIBS_INIT})
diff --git a/modules/platforms/cpp/examples/query-example/CMakeLists.txt b/modules/platforms/cpp/examples/query-example/CMakeLists.txt
index e4144a5..171269a 100644
--- a/modules/platforms/cpp/examples/query-example/CMakeLists.txt
+++ b/modules/platforms/cpp/examples/query-example/CMakeLists.txt
@@ -29,5 +29,4 @@ include_directories(../include)
add_executable(${TARGET} src/query_example.cpp)
-target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_JNI_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB}
- ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} ${IGNITE_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB} ${CMAKE_THREAD_LIBS_INIT})
diff --git a/modules/platforms/cpp/examples/thin-client-put-get-example/CMakeLists.txt b/modules/platforms/cpp/examples/thin-client-put-get-example/CMakeLists.txt
index d187eca..8caae5c 100644
--- a/modules/platforms/cpp/examples/thin-client-put-get-example/CMakeLists.txt
+++ b/modules/platforms/cpp/examples/thin-client-put-get-example/CMakeLists.txt
@@ -27,4 +27,5 @@ include_directories(../include)
add_executable(${TARGET} src/thin_client_put_get_example.cpp)
-target_link_libraries(${TARGET} ${IGNITE_THIN_CLIENT_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB} ${CMAKE_THREAD_LIBS_INIT})
+target_link_libraries(${TARGET} ${IGNITE_THIN_CLIENT_LIB} ${IGNITE_BINARY_LIB} ${IGNITE_COMMON_LIB}
+ ${CMAKE_THREAD_LIBS_INIT})
diff --git a/modules/platforms/cpp/jni/CMakeLists.txt b/modules/platforms/cpp/jni/CMakeLists.txt
deleted file mode 100644
index 1caf827..0000000
--- a/modules/platforms/cpp/jni/CMakeLists.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-project(ignite-jni)
-
-set(TARGET ${PROJECT_NAME})
-
-find_library(JVM_LIBRARY jvm ${JAVA_JVM_LIBRARY_DIRECTORIES})
-
-include_directories(SYSTEM ${JNI_INCLUDE_DIRS})
-include_directories(include)
-
-set(SOURCES src/java.cpp src/exports.cpp)
-
-if (WIN32)
- list(APPEND SOURCES os/win/src/utils.cpp)
-else()
- list(APPEND SOURCES os/linux/src/utils.cpp)
-endif()
-
-add_library(${TARGET} SHARED ${SOURCES})
-
-set_target_properties(${TARGET} PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
-
-target_link_libraries(${TARGET} ignite-common ${JVM_LIBRARY})
-
-if (WIN32)
- target_link_libraries(${TARGET} delayimp)
-
- set_target_properties(${TARGET} PROPERTIES LINK_FLAGS "/DELAYLOAD:jvm.dll")
-
- set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.jni")
-endif()
-
-target_include_directories(${TARGET} INTERFACE include)
-
-install(TARGETS ${TARGET}
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
-)
-install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h*")
diff --git a/modules/platforms/cpp/jni/include/ignite/jni/exports.h b/modules/platforms/cpp/jni/include/ignite/jni/exports.h
deleted file mode 100644
index dcd7c85..0000000
--- a/modules/platforms/cpp/jni/include/ignite/jni/exports.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _IGNITE_JNI_EXPORTS
-#define _IGNITE_JNI_EXPORTS
-
-#include "ignite/jni/java.h"
-
-namespace gcj = ignite::jni::java;
-
-extern "C" {
- int IGNITE_CALL IgniteReallocate(int64_t memPtr, int cap);
-
- void IGNITE_CALL IgniteIgnitionStart(gcj::JniContext* ctx, char* cfgPath, char* name, int factoryId, int64_t dataPtr);
- int64_t IGNITE_CALL IgniteIgnitionEnvironmentPointer(gcj::JniContext* ctx, char* name);
- bool IGNITE_CALL IgniteIgnitionStop(gcj::JniContext* ctx, char* name, bool cancel);
- void IGNITE_CALL IgniteIgnitionStopAll(gcj::JniContext* ctx, bool cancel);
-
- int64_t IGNITE_CALL IgniteTargetInLongOutLong(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr);
- int64_t IGNITE_CALL IgniteTargetInStreamOutLong(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr);
- void IGNITE_CALL IgniteTargetInStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, int64_t inMemPtr, int64_t outMemPtr);
- void* IGNITE_CALL IgniteTargetInStreamOutObject(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr);
- void* IGNITE_CALL IgniteTargetInObjectStreamOutObjectStream(gcj::JniContext* ctx, void* obj, int opType, void* arg, int64_t inMemPtr, int64_t outMemPtr);
- void IGNITE_CALL IgniteTargetOutStream(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr);
- void* IGNITE_CALL IgniteTargetOutObject(gcj::JniContext* ctx, void* obj, int opType);
- void IGNITE_CALL IgniteTargetInStreamAsync(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr);
- void* IGNITE_CALL IgniteTargetInStreamOutObjectAsync(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr);
-
- void* IGNITE_CALL IgniteAcquire(gcj::JniContext* ctx, void* obj);
- void IGNITE_CALL IgniteRelease(void* obj);
-
- void IGNITE_CALL IgniteThrowToJava(gcj::JniContext* ctx, char* errMsg);
-
- int IGNITE_CALL IgniteHandlersSize();
-
- void* IGNITE_CALL IgniteCreateContext(char** opts, int optsLen, gcj::JniHandlers* cbs);
- void IGNITE_CALL IgniteDeleteContext(gcj::JniContext* ctx);
-
- void IGNITE_CALL IgniteDestroyJvm(gcj::JniContext* ctx);
-
- void IGNITE_CALL IgniteSetConsoleHandler(gcj::ConsoleWriteHandler consoleHandler);
- void IGNITE_CALL IgniteRemoveConsoleHandler(gcj::ConsoleWriteHandler consoleHandler);
-}
-
-#endif //_IGNITE_JNI_EXPORTS
diff --git a/modules/platforms/cpp/jni/src/exports.cpp b/modules/platforms/cpp/jni/src/exports.cpp
deleted file mode 100644
index ae09909..0000000
--- a/modules/platforms/cpp/jni/src/exports.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ignite/jni/exports.h"
-#include "ignite/jni/java.h"
-
-namespace gcj = ignite::jni::java;
-
-/* --- Target methods. --- */
-extern "C" {
- int IGNITE_CALL IgniteReallocate(int64_t memPtr, int cap) {
- return gcj::JniContext::Reallocate(memPtr, cap);
- }
-
- void IGNITE_CALL IgniteIgnitionStart(gcj::JniContext* ctx, char* cfgPath, char* name, int factoryId, int64_t dataPtr) {
- ctx->IgnitionStart(cfgPath, name, factoryId, dataPtr);
- }
-
- int64_t IGNITE_CALL IgniteIgnitionEnvironmentPointer(gcj::JniContext* ctx, char* name) {
- return ctx->IgnitionEnvironmentPointer(name);
- }
-
- bool IGNITE_CALL IgniteIgnitionStop(gcj::JniContext* ctx, char* name, bool cancel) {
- return ctx->IgnitionStop(name, cancel);
- }
-
- void IGNITE_CALL IgniteIgnitionStopAll(gcj::JniContext* ctx, bool cancel) {
- return ctx->IgnitionStopAll(cancel);
- }
-
- int64_t IGNITE_CALL IgniteTargetInLongOutLong(gcj::JniContext* ctx, void* obj, int opType, int64_t val) {
- return ctx->TargetInLongOutLong(static_cast<jobject>(obj), opType, val);
- }
-
- int64_t IGNITE_CALL IgniteTargetInStreamOutLong(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr) {
- return ctx->TargetInStreamOutLong(static_cast<jobject>(obj), opType, memPtr);
- }
-
- void IGNITE_CALL IgniteTargetInStreamOutStream(gcj::JniContext* ctx, void* obj, int opType, int64_t inMemPtr, int64_t outMemPtr) {
- ctx->TargetInStreamOutStream(static_cast<jobject>(obj), opType, inMemPtr, outMemPtr);
- }
-
- void* IGNITE_CALL IgniteTargetInStreamOutObject(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr) {
- return ctx->TargetInStreamOutObject(static_cast<jobject>(obj), opType, memPtr);
- }
-
- void* IGNITE_CALL IgniteTargetInObjectStreamOutObjectStream(gcj::JniContext* ctx, void* obj, int opType, void* arg, int64_t inMemPtr, int64_t outMemPtr) {
- return ctx->TargetInObjectStreamOutObjectStream(static_cast<jobject>(obj), opType, arg, inMemPtr, outMemPtr);
- }
-
- void IGNITE_CALL IgniteTargetOutStream(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr) {
- ctx->TargetOutStream(static_cast<jobject>(obj), opType, memPtr);
- }
-
- void* IGNITE_CALL IgniteTargetOutObject(gcj::JniContext* ctx, void* obj, int opType) {
- return ctx->TargetOutObject(static_cast<jobject>(obj), opType);
- }
-
- void IGNITE_CALL IgniteTargetInStreamAsync(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr) {
- ctx->TargetInStreamAsync(static_cast<jobject>(obj), opType, memPtr);
- }
-
- void* IGNITE_CALL IgniteTargetInStreamOutObjectAsync(gcj::JniContext* ctx, void* obj, int opType, int64_t memPtr) {
- return ctx->TargetInStreamOutObjectAsync(static_cast<jobject>(obj), opType, memPtr);
- }
-
- void* IGNITE_CALL IgniteAcquire(gcj::JniContext* ctx, void* obj) {
- return ctx->Acquire(static_cast<jobject>(obj));
- }
-
- void IGNITE_CALL IgniteRelease(void* obj) {
- gcj::JniContext::Release(static_cast<jobject>(obj));
- }
-
- void IGNITE_CALL IgniteThrowToJava(gcj::JniContext* ctx, char* err) {
- ctx->ThrowToJava(err);
- }
-
- int IGNITE_CALL IgniteHandlersSize() {
- return sizeof(gcj::JniHandlers);
- }
-
- void* IGNITE_CALL IgniteCreateContext(char** opts, int optsLen, gcj::JniHandlers* cbs) {
- return gcj::JniContext::Create(opts, optsLen, *cbs);
- }
-
- void IGNITE_CALL IgniteDeleteContext(gcj::JniContext* ctx) {
- delete ctx;
- }
-
- void IGNITE_CALL IgniteDestroyJvm(gcj::JniContext* ctx) {
- ctx->DestroyJvm();
- }
-
- void IGNITE_CALL IgniteSetConsoleHandler(gcj::ConsoleWriteHandler consoleHandler) {
- gcj::JniContext::SetConsoleHandler(consoleHandler);
- }
-
- void IGNITE_CALL IgniteRemoveConsoleHandler(gcj::ConsoleWriteHandler consoleHandler) {
- gcj::JniContext::RemoveConsoleHandler(consoleHandler);
- }
-}
diff --git a/modules/platforms/cpp/network/CMakeLists.txt b/modules/platforms/cpp/network/CMakeLists.txt
index 3c3279c..e8e9703 100644
--- a/modules/platforms/cpp/network/CMakeLists.txt
+++ b/modules/platforms/cpp/network/CMakeLists.txt
@@ -45,11 +45,11 @@ list(APPEND _target_libs ${TARGET})
if (WIN32)
add_library(${TARGET}-objlib OBJECT ${SOURCES})
- add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-objlib>)
+ add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-objlib>)
list(APPEND _target_libs ${TARGET}-objlib)
-
- set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.network")
+
+ set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.network")
else()
add_library(${TARGET} SHARED ${SOURCES})
endif()
@@ -74,8 +74,8 @@ endforeach()
unset(_target_libs)
install(TARGETS ${TARGET}
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h*")
diff --git a/modules/platforms/cpp/odbc-test/README.TXT b/modules/platforms/cpp/odbc-test/README.TXT
deleted file mode 100644
index 97f4c64..0000000
--- a/modules/platforms/cpp/odbc-test/README.TXT
+++ /dev/null
@@ -1 +0,0 @@
-Contains IDE projects artifacts.
diff --git a/modules/platforms/cpp/odbc/CMakeLists.txt b/modules/platforms/cpp/odbc/CMakeLists.txt
index c9cc1fa..4c251a9 100644
--- a/modules/platforms/cpp/odbc/CMakeLists.txt
+++ b/modules/platforms/cpp/odbc/CMakeLists.txt
@@ -157,9 +157,9 @@ endif()
target_include_directories(${TARGET} INTERFACE include)
install(TARGETS ${TARGET}
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
)
if (WIN32 AND ${WITH_ODBC_MSI})
diff --git a/modules/platforms/cpp/thin-client/CMakeLists.txt b/modules/platforms/cpp/thin-client/CMakeLists.txt
index b6f41bf..29dadca 100644
--- a/modules/platforms/cpp/thin-client/CMakeLists.txt
+++ b/modules/platforms/cpp/thin-client/CMakeLists.txt
@@ -48,7 +48,7 @@ add_library(${TARGET} SHARED ${SOURCES})
set_target_properties(${TARGET} PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
if (WIN32)
- set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.thin-client")
+ set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.thin-client")
endif()
target_link_libraries(${TARGET} ignite-binary ignite-network)
@@ -56,8 +56,8 @@ target_link_libraries(${TARGET} ignite-binary ignite-network)
target_include_directories(${TARGET} INTERFACE include)
install(TARGETS ${TARGET}
- RUNTIME DESTINATION bin
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h*")