Skip to content

Commit

Permalink
[C++] Add definition for __PROJECT_SOURCE_DIR__ to the public interfa…
Browse files Browse the repository at this point in the history
…ce of aeron_client.

This is required in case there is an upper level directory that includes
Aeron. In that case the added definitions do not reach the source files
that may include Aeron headers and __PROJECT_SOURCE_DIR__ will be
undefined to them.
  • Loading branch information
denizevrenci committed Dec 17, 2018
1 parent eabd7d6 commit 795fe35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build" FORCE)
endif(NOT CMAKE_BUILD_TYPE)

# relative file paths for use in exceptions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__PROJECT_SOURCE_DIR__='\"${PROJECT_SOURCE_DIR}\"'")

set(AERON_THIRDPARTY_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/thirdparty")

##########################################################
Expand Down
5 changes: 5 additions & 0 deletions aeron-client/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ target_include_directories(aeron_client
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
)

# relative file paths for use in exceptions
target_compile_definitions(aeron_client
PUBLIC "__PROJECT_SOURCE_DIR__=\"${PROJECT_SOURCE_DIR}\""
)

if (NOT WIN32)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
Expand Down

0 comments on commit 795fe35

Please # to comment.