Re: [PATCH 0/3] Build improvements for clar

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Patrick

On 08/11/2024 13:16, Patrick Steinhardt wrote:
Hi,

Dscho has reported in [1] that the CMake build instructions for clar do
not work well on Windows/MSVC because we execute the shell scripts
directly instead of using the discovered `SH_EXE`. This small patch
series fixes the issue.

I've been using the CMake build in Visual Studio the last couple of days
as my hard drive with linux on it died. I ended up with a slightly
different fix using "sh -c" rather than putting the awk script inside
a shell script. See the diff below. I don't have a strong preference
either way but it would be nice to fix the line wrapping and add
VERBATIM so that paths containing special characters are quoted correctly

Best Wishes

Phillip

---- >8 ----

diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt
index f0a1a75382a..b8a37b3870d 100644
--- a/contrib/buildsystems/CMakeLists.txt
+++ b/contrib/buildsystems/CMakeLists.txt
@@ -989,11 +989,21 @@ parse_makefile_for_scripts(clar_test_SUITES "CLAR_TEST_SUITES" "")
 list(TRANSFORM clar_test_SUITES PREPEND "${CMAKE_SOURCE_DIR}/t/unit-tests/")
 list(TRANSFORM clar_test_SUITES APPEND ".c")
 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})
+        COMMAND ${SH_EXE}
+                "${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}
+        VERBATIM)
 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")
+        COMMAND ${SH_EXE} "-c" [[awk -f "$1" "$2" >"$3"]] awk
+                "${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"
+        VERBATIM)
add_library(unit-tests-lib ${clar_test_SUITES}
         "${CMAKE_SOURCE_DIR}/t/unit-tests/clar/clar.c"






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux