Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[C++] Add definition for __PROJECT_SOURCE_DIR__ to aeron_client's public interface #596

Merged
merged 2 commits into from
Dec 17, 2018
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
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
3 changes: 1 addition & 2 deletions aeron-driver/src/test/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
# limitations under the License.

include_directories(${AERON_DRIVER_SOURCE_PATH})
include_directories(${AERON_CLIENT_SOURCE_PATH})

set(TEST_HEADERS aeron_driver_conductor_test.h)

function(aeron_driver_test name file)
add_executable(${name} ${file} ${TEST_HEADERS})
target_link_libraries(${name} aeron_driver ${GMOCK_LIBS} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(${name} aeron_client aeron_driver ${GMOCK_LIBS} ${CMAKE_THREAD_LIBS_INIT})
add_dependencies(${name} gmock)
add_test(NAME ${name} COMMAND ${name})
endfunction()
Expand Down