Skip to content

Commit c6d29c6

Browse files
committed
wip 0.4.0: force CONFIG-mode find_package in cross stage
Pass -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON to the cross-stage CMAKE_ARGS so re2_external + other deps honor the absl_DIR / CMAKE_PREFIX_PATH hints (find_package was previously trying MODULE mode looking for Findabsl.cmake).
1 parent 6e97c01 commit c6d29c6

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

wasm-patches/litert-lm-v0.10.2/01-cmake-emscripten-support.patch

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 63ff28e..d7cd2ed 100644
2+
index 63ff28e..a474c51 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
55
@@ -27,6 +27,22 @@ if(NOT DEFINED LITERTLM_HOST_FLATC)
@@ -104,10 +104,17 @@ index 63ff28e..d7cd2ed 100644
104104

105105
INSTALL_COMMAND ""
106106
)
107-
@@ -94,6 +171,27 @@ ExternalProject_Add(
107+
@@ -94,6 +171,34 @@ ExternalProject_Add(
108108
"-DLITERTLM_HOST_FLATC=${LITERTLM_HOST_FLATC}"
109109
"-DLITERTLM_HOST_FLATC_BIN_DIR=${LITERTLM_HOST_FLATC_BIN_DIR}"
110110

111+
+ # re2_external's find_package(absl REQUIRED) was failing in MODULE
112+
+ # mode (it looks for Findabsl.cmake which doesn't exist; abseil
113+
+ # ships abslConfig.cmake for CONFIG mode). Force CONFIG mode
114+
+ # globally so all sub-ExternalProjects use the absl_DIR /
115+
+ # CMAKE_PREFIX_PATH hints we pass them.
116+
+ "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON"
117+
+
111118
+ # During the cross stage's build, cargo invokes Rust crates' build.rs
112119
+ # scripts which need to compile + link a HOST executable (not wasm).
113120
+ # The default build env has CC=emcc/CXX=em++ from the parent emcmake;

0 commit comments

Comments
 (0)