CMakeLists.txt 888 B

12345678910111213141516171819202122
  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.5)
  4. include($ENV{IDF_PATH}/tools/cmake/project.cmake)
  5. project(no_embedded_paths)
  6. idf_build_get_property(idf_path IDF_PATH)
  7. idf_build_get_property(python PYTHON)
  8. idf_build_get_property(elf EXECUTABLE)
  9. # If the configuration is one that doesn't expect the IDF_PATH to be found in binaries then run this build step
  10. # after building the ELF, will fail if it finds any file paths in binary files
  11. if(CONFIG_OPTIMIZATION_ASSERTIONS_SILENT OR
  12. CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED OR
  13. CONFIG_COMPILER_HIDE_PATHS_MACROS)
  14. add_custom_command(
  15. TARGET ${elf}
  16. POST_BUILD
  17. COMMAND ${python} "${CMAKE_CURRENT_LIST_DIR}/check_for_file_paths.py" "${idf_path}" "${CMAKE_BINARY_DIR}"
  18. )
  19. endif()