This article examines how Zephyr implements its pay-as-you-use philosophy through compile-time mechanisms. By combining Kconfig for feature selection, Devicetree for hardware description, and CMake build rules, Zephyr ensures only necessary components are compiled into the final application image.