diff --git a/examples/models/llama2/CMakeLists.txt b/examples/models/llama2/CMakeLists.txt index dd0a1c022c0..17841cd4eb4 100644 --- a/examples/models/llama2/CMakeLists.txt +++ b/examples/models/llama2/CMakeLists.txt @@ -175,8 +175,8 @@ if(ANDROID) endif() add_executable(llama_main ${_srcs}) -if(CMAKE_BUILD_TYPE EQUAL "RELEASE") - target_link_options(llama_main PRIVATE "LINKER:--gc-sections") +if(CMAKE_BUILD_TYPE STREQUAL "Release") + target_link_options(llama_main PRIVATE "LINKER:--gc-sections,-s") endif() target_include_directories(llama_main PUBLIC ${_common_include_directories}) diff --git a/examples/selective_build/CMakeLists.txt b/examples/selective_build/CMakeLists.txt index 239cdc828de..247a269d94b 100644 --- a/examples/selective_build/CMakeLists.txt +++ b/examples/selective_build/CMakeLists.txt @@ -115,7 +115,7 @@ list(TRANSFORM _executor_runner__srcs PREPEND "${EXECUTORCH_ROOT}/") # link to # add_executable(selective_build_test ${_executor_runner__srcs}) -if(CMAKE_BUILD_TYPE EQUAL "RELEASE") +if(CMAKE_BUILD_TYPE EQUAL "Release") target_link_options(selective_build_test PRIVATE "LINKER:--gc-sections") endif() target_link_libraries(