mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 11:10:06 -05:00
Tests: Add case covering a unity build with a generated source
Exclude the case on generators where it does not yet work. Issue: #21865
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
enable_language(C)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT main.c
|
||||
COMMAND ${CMAKE_COMMAND} -E copy main.c.in main.c
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/main.c.in
|
||||
)
|
||||
add_executable(main main.c)
|
||||
set_property(TARGET main PROPERTY UNITY_BUILD ON)
|
||||
|
||||
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
|
||||
set(check_pairs
|
||||
\"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.c.in\"
|
||||
\"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.c\"
|
||||
)
|
||||
set(check_exes
|
||||
\"$<TARGET_FILE:main>\"
|
||||
)
|
||||
")
|
||||
Reference in New Issue
Block a user