aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfuzzard <fuzzard@users.noreply.github.com>2023-06-17 07:19:29 +1000
committerGitHub <noreply@github.com>2023-06-17 07:19:29 +1000
commit16215faa4901d543cb02681e7a8a57af32a51878 (patch)
tree29969c022f6fee77c2c4727643c4fb5735e0486e
parent2f5330994b3adafad42dce9c7b058295177bc9e9 (diff)
parent0b4760c45e39cb11629aadd1adc2e94b16a90acd (diff)
downloadxbmc-16215faa4901d543cb02681e7a8a57af32a51878.tar.xz
Merge pull request #23386 from fuzzard/nexus_flatc
[BP][CMake][FlatC] Don't use local flatc with ENABLE_INTERNAL_FLATBUFFERS if versions don't match
-rw-r--r--cmake/modules/buildtools/FindFlatC.cmake13
1 files changed, 7 insertions, 6 deletions
diff --git a/cmake/modules/buildtools/FindFlatC.cmake b/cmake/modules/buildtools/FindFlatC.cmake
index e42c814635..bca17e8a05 100644
--- a/cmake/modules/buildtools/FindFlatC.cmake
+++ b/cmake/modules/buildtools/FindFlatC.cmake
@@ -25,14 +25,15 @@ if(NOT TARGET flatbuffers::flatc)
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX MATCH "[^\n]* version [^\n]*" FLATBUFFERS_FLATC_VERSION "${FLATBUFFERS_FLATC_VERSION}")
string(REGEX REPLACE ".* version (.*)" "\\1" FLATBUFFERS_FLATC_VERSION "${FLATBUFFERS_FLATC_VERSION}")
+ endif()
- else()
+ set(MODULE_LC flatbuffers)
+ # Duplicate URL may exist from FindFlatbuffers.cmake
+ # unset otherwise it thinks we are providing a local file location and incorrect concatenation happens
+ unset(FLATBUFFERS_URL)
+ SETUP_BUILD_VARS()
- set(MODULE_LC flatbuffers)
- # Duplicate URL may exist from FindFlatbuffers.cmake
- # unset otherwise it thinks we are providing a local file location and incorrect concatenation happens
- unset(FLATBUFFERS_URL)
- SETUP_BUILD_VARS()
+ if(NOT FLATBUFFERS_FLATC_EXECUTABLE OR (ENABLE_INTERNAL_FLATBUFFERS AND NOT "${FLATBUFFERS_FLATC_VERSION}" VERSION_EQUAL "${FLATBUFFERS_VER}"))
# Override build type detection and always build as release
set(FLATBUFFERS_BUILD_TYPE Release)