Skip to content

Commit

Permalink
fix parsec json_output OBJECT type
Browse files Browse the repository at this point in the history
  • Loading branch information
iGwkang authored Dec 25, 2024
1 parent e8804a6 commit bf92ea0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xrepo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ macro(_xrepo_fetch_json)
if("${includedirs_type}" STREQUAL "STRING")
string(JSON dir GET ${json_output} ${idx} "includedirs")
list(APPEND includedirs ${dir})
elseif("${includedirs_type}" STREQUAL "ARRAY")
elseif("${includedirs_type}" MATCHES "ARRAY|OBJECT")
string(JSON includedirs_len ERROR_VARIABLE includedirs_error LENGTH ${json_output} ${idx} "includedirs")
if("${includedirs_error}" STREQUAL "NOTFOUND" AND NOT "${includedirs_len}" EQUAL 0)
math(EXPR includedirs_end "${includedirs_len} - 1")
Expand All @@ -531,7 +531,7 @@ macro(_xrepo_fetch_json)
if("${linkdirs_type}" STREQUAL "STRING")
string(JSON dir GET ${json_output} ${idx} "linkdirs")
list(APPEND linkdirs ${dir})
elseif("${linkdirs_type}" STREQUAL "ARRAY")
elseif("${linkdirs_type}" MATCHES "ARRAY|OBJECT")
string(JSON linkdirs_len ERROR_VARIABLE linkdirs_error LENGTH ${json_output} ${idx} "linkdirs")
if("${linkdirs_error}" STREQUAL "NOTFOUND" AND NOT "${linkdirs_len}" EQUAL 0)
math(EXPR linkdirs_end "${linkdirs_len} - 1")
Expand All @@ -548,7 +548,7 @@ macro(_xrepo_fetch_json)
if("${links_type}" STREQUAL "STRING")
string(JSON dir GET ${json_output} ${idx} "links")
list(APPEND links ${dir})
elseif("${links_type}" STREQUAL "ARRAY")
elseif("${links_type}" MATCHES "ARRAY|OBJECT")
string(JSON links_len ERROR_VARIABLE links_error LENGTH ${json_output} ${idx} "links")
if("${links_error}" STREQUAL "NOTFOUND" AND NOT "${links_len}" EQUAL 0)
math(EXPR links_end "${links_len} - 1")
Expand All @@ -565,7 +565,7 @@ macro(_xrepo_fetch_json)
if("${syslinks_type}" STREQUAL "STRING")
string(JSON dir GET ${json_output} ${idx} "syslinks")
list(APPEND syslinks ${dir})
elseif("${syslinks_type}" STREQUAL "ARRAY")
elseif("${syslinks_type}" MATCHES "ARRAY|OBJECT")
string(JSON syslinks_len ERROR_VARIABLE syslinks_error LENGTH ${json_output} ${idx} "syslinks")
if("${syslinks_error}" STREQUAL "NOTFOUND" AND NOT "${syslinks_len}" EQUAL 0)
math(EXPR syslinks_end "${syslinks_len} - 1")
Expand All @@ -581,8 +581,8 @@ macro(_xrepo_fetch_json)
string(JSON defines_type ERROR_VARIABLE defines_error TYPE ${json_output} ${idx} "defines")
if("${defines_type}" STREQUAL "STRING")
string(JSON dir GET ${json_output} ${idx} "defines")
list(APPEND syslinks ${dir})
elseif("${defines_type}" STREQUAL "ARRAY")
list(APPEND defines ${dir})
elseif("${defines_type}" MATCHES "ARRAY|OBJECT")
string(JSON defines_len ERROR_VARIABLE defines_error LENGTH ${json_output} ${idx} "defines")
if("${defines_error}" STREQUAL "NOTFOUND" AND NOT "${defines_len}" EQUAL 0)
math(EXPR defines_end "${defines_len} - 1")
Expand Down

0 comments on commit bf92ea0

Please sign in to comment.