| 1 |
include(RunCMake) |
| 2 |
|
| 3 |
function(run_codegen case) |
| 4 |
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build) |
| 5 |
|
| 6 |
run_cmake(${case}) |
| 7 |
|
| 8 |
set(RunCMake_TEST_NO_CLEAN 1) |
| 9 |
|
| 10 |
run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --target codegen --config Debug) |
| 11 |
endfunction() |
| 12 |
|
| 13 |
# Builds codegen target when there are no custom commands marked codegen |
| 14 |
run_codegen("no-codegen") |
| 15 |
|
| 16 |
# We don't want codegen to drive parts of the project that are EXCLUDE_FROM_ALL |
| 17 |
run_codegen("exclude-from-all") |
| 18 |
|
| 19 |
# Ensures codegen builds minimal build graphs |
| 20 |
run_codegen("min-graph-1") |
| 21 |
run_codegen("min-graph-2") |
| 22 |
run_codegen("min-graph-3") |
| 23 |
|
| 24 |
# Handle specific cases that can affect codegen |
| 25 |
run_codegen("add-dependencies") |
| 26 |
run_codegen("add-custom-command-depends") |
| 27 |
run_codegen("byproducts") |
| 28 |
|
| 29 |
# Error handling |
| 30 |
run_cmake("implicit-depends") |
| 31 |
run_cmake("implicit-depends-append-codegen") |
| 32 |
run_cmake("append-implicit-depends") |
| 33 |
run_cmake("no-output") |
| 34 |
|
| 35 |
# Top-level codegen depends on that of subdirectories. |
| 36 |
run_codegen(SubDir) |
| 37 |
run_codegen(SubDirExcludeFromAll) |