diff --git a/CMakeLists.txt b/CMakeLists.txt index fe44cd2..05fd140 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -660,8 +660,7 @@ include(cmake/OpenCVModule.cmake) # Detect endianness of build platform # ---------------------------------------------------------------------------- -# if not working while compiling for esp32, change the next line in 'if(IOS OR ESP32)' -if(IOS) +if(IOS OR ESP32) # test_big_endian needs try_compile, which doesn't work for iOS # http://public.kitware.com/Bug/view.php?id=12288 set(WORDS_BIGENDIAN 0) diff --git a/esp32/scripts/build_opencv_for_esp32.sh b/esp32/scripts/build_opencv_for_esp32.sh index e1ffabd..1f3c756 100755 --- a/esp32/scripts/build_opencv_for_esp32.sh +++ b/esp32/scripts/build_opencv_for_esp32.sh @@ -67,7 +67,7 @@ cp $SCRIPTDIR/resources/alloc_fix.cpp ./3rdparty/ade/ade-0.1.1f/sources/ade/sour echo "================================================================================" echo "Compiling with make -j" echo "================================================================================" -make -j +make -j3 ### installing in output directory ### echo "================================================================================" diff --git a/modules/core/src/glob.cpp b/modules/core/src/glob.cpp index e6edf78..17c4733 100644 --- a/modules/core/src/glob.cpp +++ b/modules/core/src/glob.cpp @@ -133,44 +133,10 @@ namespace } #else #if defined(ESP32) +#include +#include "esp_dirent.h" #include const char dir_separators[] = "/"; - -namespace { - struct dirent { - const char *d_name; - }; - - struct DIR { - dirent ent; - - DIR() { } - ~DIR() - { - if (ent.d_name) - delete[] ent.d_name; - } - }; - - DIR* opendir(const char* path) - { - DIR* dir = new DIR; - dir->ent.d_name = 0; - // TODO implement (point the first file starting with 'path' in its name) - return dir; - } - - dirent* readdir(DIR* dir) - { - // TODO: implement (point to the next file with 'path' in its name) - return &(dir->ent); - } - - void closedir(DIR* dir) - { - delete dir; - } -} #else # include # include