CMakeLists.txt 910 B

1234567891011121314151617181920212223
  1. # The following lines of boilerplate have to be in your project's
  2. # CMakeLists in this exact order for cmake to work correctly
  3. cmake_minimum_required(VERSION 3.16)
  4. include($ENV{IDF_PATH}/tools/cmake/project.cmake)
  5. set(COMPONENTS main)
  6. project(no_embedded_paths)
  7. idf_build_get_property(idf_path IDF_PATH)
  8. idf_build_get_property(python PYTHON)
  9. idf_build_get_property(elf EXECUTABLE)
  10. # If the configuration is one that doesn't expect the IDF_PATH to be found in binaries then run this build step
  11. # after building the ELF, will fail if it finds any file paths in binary files
  12. if(CONFIG_OPTIMIZATION_ASSERTIONS_SILENT OR
  13. CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED OR
  14. CONFIG_COMPILER_HIDE_PATHS_MACROS)
  15. add_custom_command(
  16. TARGET ${elf}
  17. POST_BUILD
  18. COMMAND ${python} "${CMAKE_CURRENT_LIST_DIR}/check_for_file_paths.py" "${idf_path}" "${CMAKE_BINARY_DIR}"
  19. )
  20. endif()