diff options
author | Alper Ak <alperyasinak1@gmail.com> | 2025-07-10 00:11:12 +0300 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-07-09 14:12:53 -0700 |
commit | 40dd3e9cc14432632f48f00ba687cd485a82b0e5 (patch) | |
tree | 0adaaa424b70d5d51d40beebacf9170486e1370b | |
parent | ef64c35092d9141d1f44174b6ff856479722c103 (diff) | |
download | meta-openembedded-40dd3e9cc14432632f48f00ba687cd485a82b0e5.tar.gz |
yajl: Add patch for CMake 4+ compatibility and fix build issue
- CMake 3.0 and newer disallow reading the LOCATION property of targets directly.
Instead, use the recommended $<TARGET_FILE:target> generator expression when
referencing the output binary in add_custom_command.
Fixes:
| CMake Error at CMakeLists.txt:15 (CMAKE_MINIMUM_REQUIRED):
| Compatibility with CMake < 3.5 has been removed from CMake.
|
| Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
| to tell CMake that the project requires at least <min> but has been updated
| to work with policies introduced by <max> or earlier.
|
| Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
|
|
| -- Configuring incomplete, errors occurred!
-----
| CMake Error at reformatter/CMakeLists.txt:38 (GET_TARGET_PROPERTY):
| The LOCATION property may not be read from target "json_reformat". Use the
| target name directly with add_custom_command, or use the generator
| expression $<TARGET_FILE>, as appropriate.
|
|
|
| CMake Error at verify/CMakeLists.txt:32 (GET_TARGET_PROPERTY):
| The LOCATION property may not be read from target "json_verify". Use the
| target name directly with add_custom_command, or use the generator
| expression $<TARGET_FILE>, as appropriate.
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-devtools/yajl/yajl/0001-allow-build-with-cmake-4.patch | 93 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb | 2 |
2 files changed, 94 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/yajl/yajl/0001-allow-build-with-cmake-4.patch b/meta-oe/recipes-devtools/yajl/yajl/0001-allow-build-with-cmake-4.patch new file mode 100644 index 0000000000..78076e5c1e --- /dev/null +++ b/meta-oe/recipes-devtools/yajl/yajl/0001-allow-build-with-cmake-4.patch | |||
@@ -0,0 +1,93 @@ | |||
1 | From e67398dad70e5d0174ad0eca5c293a5bf1ce1796 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alper Ak <alperyasinak1@gmail.com> | ||
3 | Date: Thu, 10 Jul 2025 00:00:33 +0300 | ||
4 | Subject: [PATCH] cmake: Set minimum required version to 3.5 for CMake 4+ | ||
5 | compatibility | ||
6 | |||
7 | CMake 3.0 and newer disallow reading the LOCATION property of targets directly. | ||
8 | Instead, use the recommended $<TARGET_FILE:target> generator expression when | ||
9 | referencing the output binary in add_custom_command. | ||
10 | |||
11 | Fix: | ||
12 | |||
13 | | CMake Error at CMakeLists.txt:15 (CMAKE_MINIMUM_REQUIRED): | ||
14 | | Compatibility with CMake < 3.5 has been removed from CMake. | ||
15 | | | ||
16 | | Update the VERSION argument <min> value. Or, use the <min>...<max> syntax | ||
17 | | to tell CMake that the project requires at least <min> but has been updated | ||
18 | | to work with policies introduced by <max> or earlier. | ||
19 | | | ||
20 | | Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway. | ||
21 | | | ||
22 | | | ||
23 | | -- Configuring incomplete, errors occurred! | ||
24 | |||
25 | --- | ||
26 | |||
27 | | CMake Error at reformatter/CMakeLists.txt:38 (GET_TARGET_PROPERTY): | ||
28 | | The LOCATION property may not be read from target "json_reformat". Use the | ||
29 | | target name directly with add_custom_command, or use the generator | ||
30 | | expression $<TARGET_FILE>, as appropriate. | ||
31 | | | ||
32 | | | ||
33 | | | ||
34 | | CMake Error at verify/CMakeLists.txt:32 (GET_TARGET_PROPERTY): | ||
35 | | The LOCATION property may not be read from target "json_verify". Use the | ||
36 | | target name directly with add_custom_command, or use the generator | ||
37 | | expression $<TARGET_FILE>, as appropriate. | ||
38 | |||
39 | Upstream-Status: Submitted [https://github.com/lloyd/yajl/pull/256] | ||
40 | |||
41 | Signed-off-by: Alper Ak <alperyasinak1@gmail.com> | ||
42 | --- | ||
43 | CMakeLists.txt | 2 +- | ||
44 | reformatter/CMakeLists.txt | 4 +--- | ||
45 | verify/CMakeLists.txt | 4 +--- | ||
46 | 3 files changed, 3 insertions(+), 7 deletions(-) | ||
47 | |||
48 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
49 | index 4c0a9be..e7031c8 100644 | ||
50 | --- a/CMakeLists.txt | ||
51 | +++ b/CMakeLists.txt | ||
52 | @@ -12,7 +12,7 @@ | ||
53 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
54 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
55 | |||
56 | -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) | ||
57 | +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0...3.10) | ||
58 | |||
59 | PROJECT(YetAnotherJSONParser C) | ||
60 | |||
61 | diff --git a/reformatter/CMakeLists.txt b/reformatter/CMakeLists.txt | ||
62 | index 52a9bee..267d02e 100644 | ||
63 | --- a/reformatter/CMakeLists.txt | ||
64 | +++ b/reformatter/CMakeLists.txt | ||
65 | @@ -35,9 +35,7 @@ IF (NOT WIN32) | ||
66 | ENDIF (NOT WIN32) | ||
67 | |||
68 | # copy the binary into the output directory | ||
69 | -GET_TARGET_PROPERTY(binPath json_reformat LOCATION) | ||
70 | - | ||
71 | ADD_CUSTOM_COMMAND(TARGET json_reformat POST_BUILD | ||
72 | - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir}) | ||
73 | + COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:json_reformat> ${binDir}) | ||
74 | |||
75 | INSTALL(TARGETS json_reformat RUNTIME DESTINATION bin) | ||
76 | diff --git a/verify/CMakeLists.txt b/verify/CMakeLists.txt | ||
77 | index 967fca1..2f39008 100644 | ||
78 | --- a/verify/CMakeLists.txt | ||
79 | +++ b/verify/CMakeLists.txt | ||
80 | @@ -29,9 +29,7 @@ ADD_EXECUTABLE(json_verify ${SRCS}) | ||
81 | TARGET_LINK_LIBRARIES(json_verify yajl_s) | ||
82 | |||
83 | # copy in the binary | ||
84 | -GET_TARGET_PROPERTY(binPath json_verify LOCATION) | ||
85 | - | ||
86 | ADD_CUSTOM_COMMAND(TARGET json_verify POST_BUILD | ||
87 | - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${binPath} ${binDir}) | ||
88 | + COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:json_verify> ${binDir}) | ||
89 | |||
90 | INSTALL(TARGETS json_verify RUNTIME DESTINATION bin) | ||
91 | -- | ||
92 | 2.43.0 | ||
93 | |||
diff --git a/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb b/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb index e4434bee45..6951e7e705 100644 --- a/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb +++ b/meta-oe/recipes-devtools/yajl/yajl_2.1.0.bb | |||
@@ -12,10 +12,10 @@ SRC_URI = "git://github.com/lloyd/yajl;branch=master;protocol=https \ | |||
12 | file://CVE-2017-16516.patch \ | 12 | file://CVE-2017-16516.patch \ |
13 | file://CVE-2022-24795.patch \ | 13 | file://CVE-2022-24795.patch \ |
14 | file://CVE-2023-33460.patch \ | 14 | file://CVE-2023-33460.patch \ |
15 | file://0001-allow-build-with-cmake-4.patch \ | ||
15 | " | 16 | " |
16 | SRCREV = "a0ecdde0c042b9256170f2f8890dd9451a4240aa" | 17 | SRCREV = "a0ecdde0c042b9256170f2f8890dd9451a4240aa" |
17 | 18 | ||
18 | |||
19 | inherit cmake lib_package | 19 | inherit cmake lib_package |
20 | 20 | ||
21 | EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}" | 21 | EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')}" |