Skip to content

Commit

Permalink
Use C++17 explicitly
Browse files Browse the repository at this point in the history
Even though opencv appears to hard-code C++11 in some places,
those shouldn't be relevant for us, and it should respect the
user-provided CMAKE_CXX_STANDARD, see opencv/opencv#23752

Co-Authored-By: Mark Harfouche <mark.harfouche@gmail.com>
Co-Authored-By: Silvio Traversaro <silvio@traversaro.it>
  • Loading branch information
2 people authored and h-vetinari committed Jun 27, 2023
1 parent d98b752 commit 9ca2b70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ set UNIX_SRC_DIR=%SRC_DIR:\=/%
set PKG_CONFIG_PATH=%UNIX_LIBRARY_PREFIX%/lib/pkgconfig

cmake -LAH -G "Ninja" ^
-DCMAKE_CXX_STANDARD=17 ^
-DCMAKE_BUILD_TYPE="Release" ^
-DCMAKE_INSTALL_PREFIX=%UNIX_LIBRARY_PREFIX% ^
-DCMAKE_PREFIX_PATH=%UNIX_LIBRARY_PREFIX% ^
Expand Down
4 changes: 1 addition & 3 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ if [[ "${target_platform}" == linux-* ]]; then
# Looks like there's a bug in Opencv 3.2.0 for building with FFMPEG
# with GCC opencv/issues/8097
export CXXFLAGS="$CXXFLAGS -D__STDC_CONSTANT_MACROS"

export CPPFLAGS="${CPPFLAGS//-std=c++17/-std=c++11}"
export CXXFLAGS="${CXXFLAGS//-std=c++17/-std=c++11}"
OPENMP="-DWITH_OPENMP=1"
fi

Expand Down Expand Up @@ -63,6 +60,7 @@ cmake ${CMAKE_ARGS} -LAH -G "Ninja" \
-DLAPACK_LAPACKE_H=lapacke.h \
-DLAPACK_CBLAS_H=cblas.h \
-DLAPACK_LIBRARIES=lapack\;cblas \
-DCMAKE_CXX_STANDARD=17 \
-DWITH_EIGEN=1 \
-DBUILD_TESTS=0 \
-DBUILD_DOCS=0 \
Expand Down

0 comments on commit 9ca2b70

Please sign in to comment.