Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "googletest"]
path = hazelcast/test/googletest
url = git@github.com:ihsandemir/googletest.git
branch = hazelcasttest
31 changes: 18 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ project (HazelcastClient)
# -DHZ_BIT=[32 | 64]
# -DHZ_CODE_COVERAGE=ON
# -DHZ_VALGRIND=ON
# -DHZ_ADDRESS_SANITIZER=ON

INCLUDE(TestBigEndian)

SET(HZ_VERSION 3.7-SNAPSHOT)

message(STATUS "Preparing hazelcast client ..... ")

include_directories( ${CMAKE_SOURCE_DIR}/external/include/)
include_directories(${CMAKE_SOURCE_DIR}/external/include/)

#detect endianness
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
Expand All @@ -51,13 +50,6 @@ IF(NOT (${HZ_BIT} MATCHES "32") AND NOT (${HZ_BIT} MATCHES "64") )
set(HZ_BIT 64)
ENDIF(NOT (${HZ_BIT} MATCHES "32") AND NOT (${HZ_BIT} MATCHES "64"))

SET(HZ_BIT_FLAG " ")
IF(${HZ_BIT} MATCHES "32")
SET(HZ_BIT_FLAG " -m32 ")
ENDIF(${HZ_BIT} MATCHES "32")

message(STATUS "${HZ_BIT} Bit")

IF(NOT (${HZ_LIB_TYPE} MATCHES "STATIC") AND NOT (${HZ_LIB_TYPE} MATCHES "SHARED") )
message( STATUS "Build needs HZ_LIB_TYPE. Setting default as -DHZ_LIB_TYPE=STATIC (other option -DHZ_LIB_TYPE=SHARED)" )
set(HZ_LIB_TYPE STATIC)
Expand Down Expand Up @@ -105,7 +97,14 @@ ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message(STATUS "LINUX ENVIRONMENT DETECTED")


SET(HZ_BIT_FLAG " ")
IF(${HZ_BIT} MATCHES "32")
SET(HZ_BIT_FLAG " -m32 ")
ENDIF(${HZ_BIT} MATCHES "32")

message(STATUS "${HZ_BIT} Bit")

set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -Wall -Werror ${HZ_BIT_FLAG} ${HZ_CODE_COVERAGE_COMPILE_FLAGS} ${HZ_VALGRIND_COMPILE_FLAGS} ${HZ_C11_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -Wall ${HZ_BIT_FLAG} ${HZ_CODE_COVERAGE_COMPILE_FLAGS} ${HZ_VALGRIND_COMPILE_FLAGS} ${HZ_C11_FLAGS}")

Expand All @@ -127,8 +126,14 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MP /EHsc ${HZ_C11_FLAGS}")

link_libraries(${HZ_LIB_NAME})

ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

ADD_SUBDIRECTORY(hazelcast/test)
ADD_SUBDIRECTORY(examples)
IF(${HZ_BUILD_TESTS} MATCHES "ON")
SET(BUILD_GTEST "ON")
SET(DBUILD_GMOCK "OFF")
ADD_SUBDIRECTORY(hazelcast/test)
ENDIF(${HZ_BUILD_TESTS} MATCHES "ON")

IF(${HZ_BUILD_EXAMPLES} MATCHES "ON")
ADD_SUBDIRECTORY(examples)
ENDIF(${HZ_BUILD_EXAMPLES} MATCHES "ON")
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ API Documentation can be generated via doxygen from root with following command
doxygen docsConfig
```

## How to download

Clone the project from github:

git clone --recursive git@github.com:hazelcast/hazelcast-cpp-client.git

We use --recursive flag for our dependency on googletest framework.

## How to build

First create a build directory from the root of the project and in the directory run the following commands depending on your environment.
Expand All @@ -40,9 +48,6 @@ First create a build directory from the root of the project and in the directory
cmake .. -G Xcode -DHZ_LIB_TYPE=STATIC -DHZ_BIT=64 -DCMAKE_BUILD_TYPE=Debug

cmake .. -G Xcode -DHZ_LIB_TYPE=STATIC -DHZ_BIT=64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=archive -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=library
### For Linux Address Sanitizer

cmake .. -DHZ_LIB_TYPE=STATIC -DHZ_BIT=64 -DCMAKE_BUILD_TYPE=Debug -DHZ_ADDRESS_SANITIZER=ON

### valgrind sample run with suppresions

Expand All @@ -56,6 +61,16 @@ First create a build directory from the root of the project and in the directory
cmake .. -DHZ_LIB_TYPE=STATIC -DHZ_BIT=64 -DCMAKE_BUILD_TYPE=Release
cmake .. -DHZ_LIB_TYPE=SHARED -DHZ_BIT=64 -DCMAKE_BUILD_TYPE=Release

### For building the tests

Add the -DHZ_BUILD_TESTS=ON flag to the cmake flags. e.g.:
cmake .. -DHZ_LIB_TYPE=STATIC -DHZ_BIT=64 -DCMAKE_BUILD_TYPE=Debug -DHZ_BUILD_TESTS=ON

### For building the examples

Add the -DHZ_BUILD_EXAMPLES=ON flag to the cmake flags. e.g.:
cmake .. -DHZ_LIB_TYPE=STATIC -DHZ_BIT=64 -DCMAKE_BUILD_TYPE=Debug -DHZ_BUILD_EXAMPLES=ON

### For linux valgrind

cmake .. -DHZ_LIB_TYPE=STATIC -DHZ_BIT=64 -DCMAKE_BUILD_TYPE=Debug -DHZ_VALGRIND=ON
Expand Down
2 changes: 1 addition & 1 deletion examples/distributed-map/locking/PessimisticUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int main() {
map.unlock(key);
} catch (hazelcast::client::exception::IException &e) {
map.unlock(key);
throw;
throw e;
}
}
std::cout << "Finished! Result = " << map.get(key)->amount << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion examples/distributed-primitives/lock/RaceFree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main() {
}
} catch (hazelcast::client::exception::IException &e) {
lock.unlock();
throw;
throw e;
}

if (k % 2 == 0) {
Expand Down
2 changes: 1 addition & 1 deletion examples/distributed-primitives/semaphore/Semaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main() {
resource.decrementAndGet();
} catch (hazelcast::client::exception::IException &e) {
semaphore.release();
throw;
throw e;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
#pragma warning(push)
#pragma warning(disable: 4251) //for dll export
#pragma warning(disable: 4275) //for dll export
#endif

namespace hazelcast {
Expand Down
103 changes: 0 additions & 103 deletions hazelcast/include/iTest/iTest.h

This file was deleted.

136 changes: 0 additions & 136 deletions hazelcast/include/iTest/iTestFixture.h

This file was deleted.

Loading