-
Notifications
You must be signed in to change notification settings - Fork 108
Better CMake config, standard #include orders #83
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
base: master
Are you sure you want to change the base?
Better CMake config, standard #include orders #83
Conversation
There was some room for improvements, at least to ease using binapi as an ExternalProject
| ${BOOST_INCLUDE_DIR} | ||
| ) | ||
| endif() | ||
| target_compile_options(binapi PUBLIC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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.
| 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) |
There was a problem hiding this comment.
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.
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.