Skip to content

Commit

Permalink
disable thread-local
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Feb 1, 2021
1 parent bad13c0 commit 1eefd5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ jobs:
mkdir build-ios && cd build-ios
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv4_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand All @@ -277,7 +277,7 @@ jobs:
mkdir build-simulator && cd build-simulator
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv4_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
mkdir build-ios && cd build-ios
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv3_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand All @@ -332,7 +332,7 @@ jobs:
mkdir build-simulator && cd build-simulator
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv3_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand Down Expand Up @@ -377,7 +377,7 @@ jobs:
mkdir build-ios && cd build-ios
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv2_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand All @@ -387,7 +387,7 @@ jobs:
mkdir build-simulator && cd build-simulator
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=0 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv2_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand Down Expand Up @@ -433,7 +433,7 @@ jobs:
mkdir build-ios && cd build-ios
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv4_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand All @@ -443,7 +443,7 @@ jobs:
mkdir build-simulator && cd build-simulator
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv4_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand Down Expand Up @@ -488,7 +488,7 @@ jobs:
mkdir build-ios && cd build-ios
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv3_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand All @@ -498,7 +498,7 @@ jobs:
mkdir build-simulator && cd build-simulator
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv3_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand Down Expand Up @@ -543,7 +543,7 @@ jobs:
mkdir build-ios && cd build-ios
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=OS -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="armv7;arm64;arm64e" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv2_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand All @@ -553,7 +553,7 @@ jobs:
mkdir build-simulator && cd build-simulator
cmake -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake \
-DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions" -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions" \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" -DIOS_DEPLOYMENT_TARGET=9.0 \
-DIOS_PLATFORM=SIMULATOR -DENABLE_BITCODE=1 -DENABLE_ARC=0 -DENABLE_VISIBILITY=0 -DIOS_ARCH="i386;x86_64" \
-DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release `cat ../../opencv2_cmake_options.txt` -DBUILD_opencv_world=ON ..
cmake --build . -j 2
cmake --build . --target install
Expand Down
5 changes: 1 addition & 4 deletions highgui/src/highgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
#include <string.h>

#define STB_IMAGE_IMPLEMENTATION
#define STBI_NO_THREAD_LOCALS
#define STBI_ONLY_JPEG
#define STBI_ONLY_PNG
#define STBI_ONLY_BMP
#define STBI_ONLY_PNM
#if __APPLE__
#define STBI_NO_THREAD_LOCALS
#define STBI_THREAD_LOCAL thread_local
#endif
#include "stb_image.h"

#define STB_IMAGE_WRITE_IMPLEMENTATION
Expand Down
4 changes: 2 additions & 2 deletions ios.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ if (NOT DEFINED IOS_DEPLOYMENT_TARGET)
set(IOS_DEPLOYMENT_TARGET "2.0"
CACHE STRING "Minimum iOS version to build for." )
else()
# Unless specified, SDK version 8.0 is used by default as minimum target version (iOS, tvOS).
set(IOS_DEPLOYMENT_TARGET "8.0"
# Unless specified, SDK version 9.0 is used by default as minimum target version (iOS, tvOS).
set(IOS_DEPLOYMENT_TARGET "9.0"
CACHE STRING "Minimum iOS version to build for." )
endif()
message(STATUS "Using the default min-version since IOS_DEPLOYMENT_TARGET not provided!")
Expand Down

0 comments on commit 1eefd5b

Please sign in to comment.