Skip to content

Commit a9ab867

Browse files
swolchokConarnar
authored andcommitted
Turn BUILD_TESTING off if EXECUTORCH_BUILD_TESTS is off (pytorch#12566)
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?)
1 parent 9f81636 commit a9ab867

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)
@@ -744,7 +748,10 @@ if(EXECUTORCH_BUILD_EXECUTOR_RUNNER)
744748
endif()
745749

746750
set(CMAKE_EXECUTABLE_SUFFIX ".html")
747-
target_link_options(executor_runner PUBLIC -sALLOW_MEMORY_GROWTH --embed-file "${WASM_MODEL_DIR}@/")
751+
target_link_options(
752+
executor_runner PUBLIC -sALLOW_MEMORY_GROWTH --embed-file
753+
"${WASM_MODEL_DIR}@/"
754+
)
748755
endif()
749756
endif()
750757

0 commit comments

Comments
 (0)