Skip to content

Conversation

@jfsmig
Copy link

@jfsmig jfsmig commented Mar 25, 2024

The present CMake configuration helps importing binapi as an ExternalProject in an upper layer.

The order of includes has been reviewed to respect the generally-admitted standard of "C system, C++ system, C deps, C++ deps, local".

Also, CMake packages are used to locate the dependencies.

${BOOST_INCLUDE_DIR}
)
endif()
target_compile_options(binapi PUBLIC
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
target_compile_options(binapi PUBLIC
target_compile_options(binapi PRIVATE

You probably don’t want to propagate these options to users.

Also, -s is a linker option, I'm not sure it has any effect here. Better to move to target_link_options.

Comment on lines +42 to +55
add_executable(example_asynchronous-user_data examples/asynchronous-user_data/main.cpp)
target_link_libraries(example_asynchronous-user_data binapi)

add_executable(example_synchronous examples/synchronous/main.cpp)
target_link_libraries(example_synchronous binapi)

add_executable(example_synchronous-user_data examples/synchronous-user_data/main.cpp)
target_link_libraries(example_synchronous-user_data binapi)

add_executable(example_websockets examples/websockets/main.cpp)
target_link_libraries(example_websockets binapi)

add_executable(example_api main.cpp)
target_link_libraries(example_api binapi)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add_subdirectory or FetchContent_Declare will lead to building of all these targets. Better to either add an option to conditionally build them or set EXCLUDE_FROM_ALL for each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants