Skip to content

Ninja support #144

@Risto97

Description

@Risto97

Its very close to have Ninja support for SoCMake, there are minor things that are making it fail now

  1. 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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions