mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-31 00:03:08 +03:00
cmake: add and test "unity" builds
"Unity" (aka "jumbo", aka "amalgamation" builds concatenate source files before compiling. It has these benefits for example: faster builds, improved code optimization, cleaner code. Let's support and test this. - enable unity builds for some existing CI builds to test this build scenario. - tune `UNITY_BUILD_BATCH_SIZE` size. - disable unity build for example and test programs (they use one source each already). You can enable it by passing `-DCMAKE_UNITY_BUILD=ON` to cmake. Supported by CMake 3.16 and newer. Ref: https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html Closes #1034
This commit is contained in:
@ -48,6 +48,7 @@ foreach(example ${EXAMPLES})
|
||||
# to find generated header
|
||||
target_include_directories(${example} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src ../src)
|
||||
target_link_libraries(${example} ${LIB_SELECTED} ${LIBRARIES})
|
||||
set_target_properties(${example} PROPERTIES UNITY_BUILD false)
|
||||
endforeach()
|
||||
|
||||
add_target_to_copy_dependencies(
|
||||
|
Reference in New Issue
Block a user