Skip to content

Commit bd69404

Browse files
committed
Run selective build CI test with more restrictions
Revert reason for #14487 was that internal tests were running with "-Werror,-Wunused-variable" option but not OSS tests
1 parent c9f46e2 commit bd69404

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

codegen/tools/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,17 @@ target_include_directories(
2424

2525
# Compile options
2626
target_compile_options(
27-
selective_build PUBLIC -Wno-deprecated-declarations -fPIC -frtti -fexceptions
27+
selective_build
28+
PUBLIC -Wno-deprecated-declarations
29+
-fPIC
30+
-frtti
31+
-fexceptions
32+
-Werror
33+
-Wunused-variable
34+
-Wno-unknown-argument
2835
)
36+
# We suppress -Wno-unknown-argument because our build system passes -fPIC for
37+
# Unix builds, but we also build on Windows where it's ignored
2938

3039
# Link against required libraries
3140
target_link_libraries(selective_build PRIVATE executorch_core program_schema)

codegen/tools/selective_build.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ get_kernel_tensor_metadatas_from_execution_plan(
186186

187187
const executorch_flatbuffer::Program* _get_program_from_buffer(
188188
const py::bytes& buffer) {
189+
int test = 1;
189190
return executorch_flatbuffer::GetProgram(
190191
buffer.cast<std::string_view>().data());
191192
}

examples/selective_build/test_selective_build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ fi
183183
if [[ $1 == "cmake" ]];
184184
then
185185
cmake_install_executorch_lib $CMAKE_BUILD_TYPE
186+
187+
# Build selective_build module for model-based selection
188+
echo "Building selective_build Python module..."
189+
cmake -DEXECUTORCH_BUILD_PYBIND=ON \
190+
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
191+
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
192+
-Bcmake-out .
193+
cmake --build cmake-out --target selective_build -j9
194+
186195
test_cmake_select_ops_in_list
187196
test_cmake_select_ops_in_yaml
188197
test_cmake_select_ops_in_model

0 commit comments

Comments
 (0)