Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Modular build and copy paste fixes #561

Merged
merged 7 commits into from
Oct 26, 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
20 changes: 14 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ option(SANITISE_BUILD "Enable sanitise options" OFF)
option(COVERAGE_BUILD "Enable code coverage" OFF)
option(AERON_TESTS "Enable tests" ${STANDALONE_BUILD})
option(AERON_BUILD_SAMPLES "Enable building the sample projects" ${STANDALONE_BUILD})
option(AERON_BUILD_DOCUMENTATION "Build Aeron documentation" ${STANDALONE_BUILD})
option(AERON_INSTALL_TARGETS "Enable installation step" ${STANDALONE_BUILD})

unset(STANDALONE_BUILD)

Expand Down Expand Up @@ -137,9 +139,13 @@ find_package(Threads)
##########################################################
# Doxygen for generating doc

find_package(Doxygen)
if(AERON_BUILD_DOCUMENTATION)
find_package(Doxygen)
endif()

set(CMAKE_CXX_STANDARD 11)
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
endif()

# all UNIX-based platform compiler flags
if(UNIX)
Expand Down Expand Up @@ -262,7 +268,7 @@ endif(BUILD_AERON_DRIVER)
##########################################################
# doc target

if(DOXYGEN_FOUND)
if(AERON_BUILD_DOCUMENTATION AND DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cppbuild/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)

add_custom_target(
Expand All @@ -272,9 +278,11 @@ if(DOXYGEN_FOUND)
COMMENT "Generating API documentation with Doxygen" VERBATIM
)

# install the doc if it has been built
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION share OPTIONAL)
endif(DOXYGEN_FOUND)
if(AERON_INSTALL_TARGETS)
# install the doc if it has been built
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION share OPTIONAL)
endif()
endif()

##########################################################
# package target
Expand Down
6 changes: 4 additions & 2 deletions aeron-client/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,7 @@ target_link_libraries(aeron_client
INTERFACE ${CMAKE_THREAD_LIBS_INIT}
)

install(TARGETS aeron_client ARCHIVE DESTINATION lib)
install(DIRECTORY . DESTINATION include FILES_MATCHING PATTERN "*.h")
if (AERON_INSTALL_TARGETS)
install(TARGETS aeron_client ARCHIVE DESTINATION lib)
install(DIRECTORY . DESTINATION include FILES_MATCHING PATTERN "*.h")
endif()
2 changes: 1 addition & 1 deletion aeron-client/src/main/cpp/ExclusivePublication.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ExclusivePublication
}

/**
* Registration Id returned by Aeron::addPublication when this Publication was added.
* Registration Id returned by Aeron::addExclusivePublication when this Publication was added.
*
* @return the registrationId of the publication.
*/
Expand Down
2 changes: 1 addition & 1 deletion aeron-client/src/main/cpp/Subscription.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ class Subscription
/// @endcond

/**
* Get the status for the channel of this {@link Publication}
* Get the status for the channel of this {@link Subscription}
*
* @return status code for this channel
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ TEST(OneToOneRingBufferConcurrentTest, shouldExchangeMessages)
OneToOneRingBuffer ringBuffer(spscAb);

std::atomic<int> countDown(1);
std::atomic<int> publisherId(0);

std::vector<std::thread> threads;

Expand Down
14 changes: 8 additions & 6 deletions aeron-driver/src/main/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ target_link_libraries(
${AERON_LIB_M_LIBS}
${CMAKE_THREAD_LIBS_INIT})

install(
TARGETS aeron_driver aeron_driver_agent
RUNTIME DESTINATION lib
LIBRARY DESTINATION lib)
install(TARGETS aeronmd DESTINATION bin)
install(DIRECTORY . DESTINATION include/aeronmd FILES_MATCHING PATTERN "*.h")
if (AERON_INSTALL_TARGETS)
install(
TARGETS aeron_driver aeron_driver_agent
RUNTIME DESTINATION lib
LIBRARY DESTINATION lib)
install(TARGETS aeronmd DESTINATION bin)
install(DIRECTORY . DESTINATION include/aeronmd FILES_MATCHING PATTERN "*.h")
endif()
1 change: 0 additions & 1 deletion aeron-driver/src/test/c/aeron_spsc_rb_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ TEST(SpscRbConcurrentTest, shouldExchangeMessages)
ASSERT_EQ(aeron_spsc_rb_init(&rb, spsc_buffer.data(), spsc_buffer.size()), 0);

std::atomic<int> countDown(1);
std::atomic<int> publisherId(0);

std::vector<std::thread> threads;
size_t msgCount = 0;
Expand Down
8 changes: 5 additions & 3 deletions aeron-samples/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ target_link_libraries(PingPong

add_dependencies(PingPong hdr_histogram)

install(
TARGETS AeronStat BasicPublisher TimeTests BasicSubscriber StreamingPublisher RateSubscriber Ping Pong Throughput ErrorStat ExclusiveThroughput PingPong
DESTINATION bin)
if (AERON_INSTALL_TARGETS)
install(
TARGETS AeronStat BasicPublisher TimeTests BasicSubscriber StreamingPublisher RateSubscriber Ping Pong Throughput ErrorStat ExclusiveThroughput PingPong
DESTINATION bin)
endif()