From 3a891082495a7f1fb1e64b69ed92bdf611419f35 Mon Sep 17 00:00:00 2001 From: Mergen Nachin Date: Mon, 22 Sep 2025 17:29:54 -0400 Subject: [PATCH] Run selective build CI test with more restrictions Revert reason for https://github.com/pytorch/executorch/pull/14487 was that internal tests were running with "-Werror,-Wunused-variable" option but not OSS tests --- codegen/tools/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/codegen/tools/CMakeLists.txt b/codegen/tools/CMakeLists.txt index 489a96aafb6..bd0408a0e64 100644 --- a/codegen/tools/CMakeLists.txt +++ b/codegen/tools/CMakeLists.txt @@ -24,8 +24,17 @@ target_include_directories( # Compile options target_compile_options( - selective_build PUBLIC -Wno-deprecated-declarations -fPIC -frtti -fexceptions + selective_build + PUBLIC -Wno-deprecated-declarations + -fPIC + -frtti + -fexceptions + -Werror + -Wunused-variable + -Wno-unknown-argument ) +# We suppress -Wno-unknown-argument because our build system passes -fPIC for +# Unix builds, but we also build on Windows where it's ignored # Link against required libraries target_link_libraries(selective_build PRIVATE executorch_core program_schema)