git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cmake: rename clar-related variables to avoid confusion
@ 2024-09-18 19:21 Johannes Schindelin via GitGitGadget
  2024-09-19  0:30 ` Junio C Hamano
  2024-09-24 10:05 ` Patrick Steinhardt
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2024-09-18 19:21 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

In c3de556a841f (Makefile: rename clar-related variables to avoid
confusion, 2024-09-10) some `Makefile` variables were renamed that were
partially used by the CMake definition. Adapt the latter to the new lay
of the land.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
    cmake: rename clar-related variables to avoid confusion
    
    This is an add-on for ps/clar-unit-tests to let it build with CMake and
    Visual C.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1795%2Fdscho%2Fclar-unit-tests%2Bcmake-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1795/dscho/clar-unit-tests+cmake-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1795

 contrib/buildsystems/CMakeLists.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index 608fd3fe709..7890bc40c5f 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -1004,14 +1004,14 @@ foreach(unit_test ${unit_test_PROGRAMS})
 	endif()
 endforeach()
 
-parse_makefile_for_scripts(unit_tests_SUITES "UNIT_TESTS_SUITES" "")
+parse_makefile_for_scripts(clar_test_SUITES "CLAR_TEST_SUITES" "")
 
 set(clar_decls "")
 set(clar_cbs "")
 set(clar_cbs_count 0)
 set(clar_suites "static struct clar_suite _clar_suites[] = {\n")
-list(LENGTH unit_tests_SUITES clar_suites_count)
-foreach(suite ${unit_tests_SUITES})
+list(LENGTH clar_test_SUITES clar_suites_count)
+foreach(suite ${clar_test_SUITES})
 	file(STRINGS "${CMAKE_SOURCE_DIR}/t/unit-tests/${suite}.c" decls
 		REGEX "^void test_${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*\\(void\\)$")
 
@@ -1042,9 +1042,9 @@ string(APPEND clar_suites
 file(WRITE "${CMAKE_BINARY_DIR}/t/unit-tests/clar-decls.h" "${clar_decls}")
 file(WRITE "${CMAKE_BINARY_DIR}/t/unit-tests/clar.suite" "${clar_decls}" "${clar_cbs}" "${clar_suites}")
 
-list(TRANSFORM unit_tests_SUITES PREPEND "${CMAKE_SOURCE_DIR}/t/unit-tests/")
-list(TRANSFORM unit_tests_SUITES APPEND ".c")
-add_library(unit-tests-lib ${unit_tests_SUITES} "${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c")
+list(TRANSFORM clar_test_SUITES PREPEND "${CMAKE_SOURCE_DIR}/t/unit-tests/")
+list(TRANSFORM clar_test_SUITES APPEND ".c")
+add_library(unit-tests-lib ${clar_test_SUITES} "${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c")
 target_include_directories(unit-tests-lib PRIVATE "${CMAKE_SOURCE_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)

base-commit: c3de556a841f132832f742d1c4d3a2618ee3b355
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cmake: rename clar-related variables to avoid confusion
  2024-09-18 19:21 [PATCH] cmake: rename clar-related variables to avoid confusion Johannes Schindelin via GitGitGadget
@ 2024-09-19  0:30 ` Junio C Hamano
  2024-09-24 10:05 ` Patrick Steinhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2024-09-19  0:30 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> In c3de556a841f (Makefile: rename clar-related variables to avoid
> confusion, 2024-09-10) some `Makefile` variables were renamed that were
> partially used by the CMake definition. Adapt the latter to the new lay
> of the land.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>     cmake: rename clar-related variables to avoid confusion
>     
>     This is an add-on for ps/clar-unit-tests to let it build with CMake and
>     Visual C.

Thanks.  

The base topic is expected to graduate to 'master' in a day or two,
so this is a very timely and welcome update.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cmake: rename clar-related variables to avoid confusion
  2024-09-18 19:21 [PATCH] cmake: rename clar-related variables to avoid confusion Johannes Schindelin via GitGitGadget
  2024-09-19  0:30 ` Junio C Hamano
@ 2024-09-24 10:05 ` Patrick Steinhardt
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick Steinhardt @ 2024-09-24 10:05 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

On Wed, Sep 18, 2024 at 07:21:16PM +0000, Johannes Schindelin via GitGitGadget wrote:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> In c3de556a841f (Makefile: rename clar-related variables to avoid
> confusion, 2024-09-10) some `Makefile` variables were renamed that were
> partially used by the CMake definition. Adapt the latter to the new lay
> of the land.

Ah, thanks for the fixup! I really hope that I can (soonish) make the
case for CMake being part of our officially supported build systems that
is also exercised as part of our CI.

Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-09-24 10:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-18 19:21 [PATCH] cmake: rename clar-related variables to avoid confusion Johannes Schindelin via GitGitGadget
2024-09-19  0:30 ` Junio C Hamano
2024-09-24 10:05 ` Patrick Steinhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).