Its very close to have Ninja support for SoCMake, there are minor things that are making it fail now
- Ninja does not like when a multiple targets generate the same outputs.
For example here:
|
add_custom_command( |
|
OUTPUT ${STAMP_FILE} |
|
COMMAND ${ghdl_analyze_cmd} |
|
COMMAND touch ${STAMP_FILE} |
|
BYPRODUCTS ${cf_files} ${obj_files} |
|
WORKING_DIRECTORY ${OUTDIR} |
|
DEPENDS ${VHDL_SOURCES} ${__ghdl_subdep_stamp_files} |
|
COMMENT ${DESCRIPTION} |
BYPRODUCTS are used for cleaning the additional generated files, and one file repeats for multiple custom commands:
|
list(APPEND cf_files "${lib_outdir}/${__comp_lib_name}-obj${STANDARD}.cf") |
We should use ADDITIONAL_CLEAN_FILES property for this instead
Ninja comes with some nice features compared to Make.
- It can list the input file dependencies for a target with
ninja -t inputs
- It can generate graph with file level dependencies (compared to CMake target level) with
ninja -t graph
- It should be faster?
- Browse the dependencies in the web browser with
ninja -t browse
- Possibly solves the file dependencies for custom command across subdirectories, so add_dependencies are not needed anymore
- Custom status messages with
NINJA_STATUS variable
- And more
Its very close to have Ninja support for SoCMake, there are minor things that are making it fail now
For example here:
SoCMake/cmake/sim/ghdl/ghdl.cmake
Lines 210 to 217 in 308fc14
BYPRODUCTS are used for cleaning the additional generated files, and one file repeats for multiple custom commands:
SoCMake/cmake/sim/ghdl/ghdl.cmake
Line 197 in 308fc14
We should use ADDITIONAL_CLEAN_FILES property for this instead
Ninja comes with some nice features compared to Make.
ninja -t inputsninja -t graphninja -t browseNINJA_STATUSvariable