Sfoglia il codice sorgente

Merge branch 'bugfix/error_on_building_in_idf_path_v4.1' into 'release/v4.1'

cmake: Error out when building in IDF_PATH dir (v4.1)

See merge request espressif/esp-idf!8297
Angus Gratton 5 anni fa
parent
commit
f4243de752
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      CMakeLists.txt

+ 6 - 0
CMakeLists.txt

@@ -1,6 +1,12 @@
 cmake_minimum_required(VERSION 3.5)
 project(esp-idf C CXX ASM)
 
+if(CMAKE_CURRENT_LIST_DIR STREQUAL CMAKE_SOURCE_DIR)
+    message(FATAL_ERROR "Current directory '${CMAKE_CURRENT_LIST_DIR}' is not buildable. "
+    "Change directories to one of the example projects in '${CMAKE_CURRENT_LIST_DIR}/examples' and try "
+    "again.")
+endif()
+
 unset(compile_options)
 unset(c_compile_options)
 unset(cxx_compile_options)