git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] cmake: set up proper dependencies for generated clar headers

From
Taylor Blau <me@ttaylorr.com>
Date
Oct 14, 2024, 21:47 UTC
Message-ID
<Zw2RaUNoQz+OTcKZ@nand.local>
In-Reply-To
<129d28ae48ad984e9fae8bf803ae50a390b15a46.1728914219.git.ps@pks.im>
On Mon, Oct 14, 2024 at 04:06:47PM +0200, Patrick Steinhardt wrote:
> The auto-generated headers used by clar are written at configure time
> and thus do not get regenerated automatically. Refactor the build
> recipes such that we use custom commands instead, which also has the
> benefit that we can reuse the same infrastructure as our Makefile.
OK.
Show 15 quoted lines
> +add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h"
> +	COMMAND ${CMAKE_SOURCE_DIR}/t/unit-tests/generate-clar-decls.sh "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h" ${clar_test_SUITES}
> +	DEPENDS ${CMAKE_SOURCE_DIR}/t/unit-tests/generate-clar-decls.sh ${clar_test_SUITES})
> +add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
> +	COMMAND awk -f "${CMAKE_SOURCE_DIR}/t/unit-tests/clar-generate.awk" "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h" > "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
> +	DEPENDS "${CMAKE_SOURCE_DIR}/t/unit-tests/clar-generate.awk" "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h")
> +
> +add_library(unit-tests-lib ${clar_test_SUITES}
> +	"${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c"
> +	"${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h"
> +	"${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite"
> +)
>  target_include_directories(unit-tests-lib PUBLIC "${CMAKE_BINARY_DIR}/t/unit-tests")
>  add_executable(unit-tests "${CMAKE_SOURCE_DIR}/t/unit-tests/unit-test.c")
>  target_link_libraries(unit-tests unit-tests-lib common-main)
Ahh. The post-image is a definite improvement ;-).

Thanks, Taylor

Previous: Patrick SteinhardtNext: Taylor Blau
Message 11 of 20 in “Bug report”
  1. Ed ReelOct 9, 2024
  2. Johannes SchindelinOct 14, 2024
  3. 0/3 cmake: fix autogenerated clar headersPatrick Steinhardt, Oct 14, 2024
  4. 1/3 Makefile: extract script to generate clar declarationsPatrick Steinhardt, Oct 14, 2024
  5. Taylor BlauOct 14, 2024
  6. Patrick SteinhardtOct 15, 2024
  7. 2/3 cmake: fix compilation of clar-based unit testsPatrick Steinhardt, Oct 14, 2024
  8. Taylor BlauOct 14, 2024
  9. Patrick SteinhardtOct 15, 2024
  10. 3/3 cmake: set up proper dependencies for generated clar headersPatrick Steinhardt, Oct 14, 2024
  11. Taylor BlauOct 14, 2024
  12. Taylor BlauOct 14, 2024
  13. 0/3 cmake: fix autogenerated clar headersPatrick Steinhardt, Oct 15, 2024
  14. 1/3 Makefile: extract script to generate clar declarationsPatrick Steinhardt, Oct 15, 2024
  15. Taylor BlauOct 15, 2024
  16. Toon ClaesOct 18, 2024
  17. Patrick SteinhardtOct 21, 2024
  18. 2/3 cmake: fix compilation of clar-based unit testsPatrick Steinhardt, Oct 15, 2024
  19. 3/3 cmake: set up proper dependencies for generated clar headersPatrick Steinhardt, Oct 15, 2024
  20. Taylor BlauOct 15, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.