Skip to content

Commit 2bff9bd

Browse files
committed
Turn BUILD_TESTING off if EXECUTORCH_BUILD_TESTS is off
As the comment notes, it looks like otherwise we have third-party deps that might include(CTest) and thereby turn on testing even though our specific option is off. (Should we get rid of the specific option or more directly alias it to BUILD_TESTING?) ghstack-source-id: ebd95b6 ghstack-comment-id: 3081826265 Pull-Request: #12566
1 parent 00b02f1 commit 2bff9bd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ endif()
161161

162162
if(EXECUTORCH_BUILD_TESTS)
163163
include(CTest)
164+
else()
165+
# It looks like some of our third-party deps will try to turn this on if it's
166+
# not explicitly set, leading to confusing behavior.
167+
set(BUILD_TESTING OFF)
164168
endif()
165169

166170
add_subdirectory(third-party)
@@ -737,7 +741,10 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
737741
endif()
738742

739743
set(CMAKE_EXECUTABLE_SUFFIX ".html")
740-
target_link_options(executor_runner PUBLIC -sALLOW_MEMORY_GROWTH --embed-file "${WASM_MODEL_DIR}@/")
744+
target_link_options(
745+
executor_runner PUBLIC -sALLOW_MEMORY_GROWTH --embed-file
746+
"${WASM_MODEL_DIR}@/"
747+
)
741748
endif()
742749
endif()
743750

0 commit comments

Comments
 (0)