Skip to content

Commit

Permalink
Revert "Revert "Merge pull request xbmc#18403 from lrusak/cpp17""
Browse files Browse the repository at this point in the history
This reverts commit bd6818f.
  • Loading branch information
ksooo committed Nov 4, 2020
1 parent 819bd38 commit f829348
Show file tree
Hide file tree
Showing 17 changed files with 999 additions and 172 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/FindLCMS2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# LCMS2::LCMS2 - The LCMS Color Management library

if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_LCMS2 lcms2 QUIET)
pkg_check_modules(PC_LCMS2 lcms2>=2.10 QUIET)
endif()

find_path(LCMS2_INCLUDE_DIR NAMES lcms2.h
Expand All @@ -33,7 +33,7 @@ find_package_handle_standard_args(LCMS2
if(LCMS2_FOUND)
set(LCMS2_LIBRARIES ${LCMS2_LIBRARY})
set(LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
set(LCMS2_DEFINITIONS -DHAVE_LCMS2=1)
set(LCMS2_DEFINITIONS -DHAVE_LCMS2=1 -DCMS_NO_REGISTER_KEYWORD=1)

if(NOT TARGET LCMS2::LCMS2)
add_library(LCMS2::LCMS2 UNKNOWN IMPORTED)
Expand Down
4 changes: 1 addition & 3 deletions cmake/scripts/common/CompilerSettings.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Languages and global compiler settings
if(NOT DEFINED CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 14)
set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp")
1 change: 0 additions & 1 deletion cmake/scripts/windowsstore/ArchSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ list(APPEND SYSTEM_DEFINES -DHAS_WIN10_NETWORK)

# The /MP option enables /FS by default.
set(CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS} /EHsc /await")
set(CMAKE_CXX_STANDARD 17)
# Google Test needs to use shared version of runtime libraries
set(gtest_force_shared_crt ON CACHE STRING "" FORCE)

Expand Down
2 changes: 1 addition & 1 deletion docs/README.Fedora.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ git clone https://github.com/xbmc/xbmc kodi
## 3. Install the required packages
If you get a `package not found` type of message with the below command, remove the offending package(s) from the install list and reissue the command. Take a note of the missing dependencies and, after a successful step completion, **[build the missing dependencies manually](README.Linux.md#31-build-missing-dependencies)**.

**NOTE:** Kodi requires a compiler with C++14 support, i.e. gcc >= 4.9 or clang >= 3.4
**NOTE:** Kodi requires a compiler with C++17 support, i.e. gcc >= 7 or clang >= 5

Install build dependencies:
```
Expand Down
2 changes: 1 addition & 1 deletion docs/README.FreeBSD.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ git clone https://github.com/xbmc/xbmc kodi
## 3. Install the required packages
If you get a `package not found` type of message with the below command, remove the offending package(s) from the install list and reissue the command. Take a note of the missing dependencies and, after a successful step completion, **[build the missing dependencies manually](#31-build-missing-dependencies)**.

**NOTE:** Kodi requires a compiler with C++14 support, i.e. gcc >= 4.9 or clang >= 3.4
**NOTE:** Kodi requires a compiler with C++17 support, i.e. gcc >= 7 or clang >= 5

Install build dependencies:
```
Expand Down
4 changes: 2 additions & 2 deletions docs/README.Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ git clone https://github.com/xbmc/xbmc kodi
## 3. Install the required packages
The following is the list of packages that are used to build Kodi on Debian/Ubuntu (with all supported external libraries enabled).

**NOTE:** Kodi requires a compiler with C++14 support, i.e. gcc >= 4.9 or clang >= 3.4
**NOTE:** Kodi requires a compiler with C++17 support, i.e. gcc >= 7 or clang >= 5

* autoconf, automake, autopoint, gettext, autotools-dev, cmake, curl, default-jre | openjdk-6-jre | openjdk-7-jre, gawk, gcc (>= 4.9) | gcc-4.9, g++ (>= 4.9) | g++-4.9, cpp (>= 4.9) | cpp-4.9, flatbuffers, gdc, gperf, libasound2-dev | libasound-dev, libass-dev (>= 0.9.8), libavahi-client-dev, libavahi-common-dev, libbluetooth-dev, libbluray-dev, libbz2-dev, libcdio-dev, libcec4-dev | libcec-dev, libp8-platform-dev, libcrossguid-dev, libcurl4-openssl-dev | libcurl4-gnutls-dev | libcurl-dev, libcwiid-dev, libdbus-1-dev, libegl1-mesa-dev, libenca-dev, libflac-dev, libfontconfig-dev, libfmt3-dev | libfmt-dev, libfreetype6-dev, libfribidi-dev, libfstrcmp-dev, libgcrypt-dev, libgif-dev (>= 5.0.5), libgles2-mesa-dev [armel] | libgl1-mesa-dev | libgl-dev, libglew-dev, libglu1-mesa-dev | libglu-dev, libgnutls-dev | libgnutls28-dev, libgpg-error-dev, libgtest-dev, libiso9660-dev, libjpeg-dev, liblcms2-dev, liblirc-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev, libmysqlclient-dev, libnfs-dev, libogg-dev, libomxil-bellagio-dev [armel], libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpulse-dev, libshairplay-dev, libsmbclient-dev, libspdlog-dev, libsqlite3-dev, libssl-dev, libtag1-dev (>= 1.8) | libtag1x8, libtiff5-dev | libtiff-dev | libtiff4-dev, libtinyxml-dev, libtool, libudev-dev, libva-dev, libvdpau-dev, libvorbis-dev, libxkbcommon-dev, libxmu-dev, libxrandr-dev, libxslt1-dev | libxslt-dev, libxt-dev, waylandpp-dev | netcat, wayland-protocols | wipe, lsb-release, meson (>= 0.47.0), nasm (>= 2.14), ninja-build, python3-dev, python3-pil | python-imaging, python-support | python3-minimal, rapidjson-dev, swig, unzip, uuid-dev, yasm, zip, zlib1g-dev
* autoconf, automake, autopoint, gettext, autotools-dev, cmake, curl, default-jre | openjdk-6-jre | openjdk-7-jre, gawk, gcc (>= 7) | gcc-7, g++ (>= 7) | g++-7, cpp (>= 7) | cpp-7, flatbuffers, gdc, gperf, libasound2-dev | libasound-dev, libass-dev (>= 0.9.8), libavahi-client-dev, libavahi-common-dev, libbluetooth-dev, libbluray-dev, libbz2-dev, libcdio-dev, libcec4-dev | libcec-dev, libp8-platform-dev, libcrossguid-dev, libcurl4-openssl-dev | libcurl4-gnutls-dev | libcurl-dev, libcwiid-dev, libdbus-1-dev, libegl1-mesa-dev, libenca-dev, libflac-dev, libfontconfig-dev, libfmt3-dev | libfmt-dev, libfreetype6-dev, libfribidi-dev, libfstrcmp-dev, libgcrypt-dev, libgif-dev (>= 5.0.5), libgles2-mesa-dev [armel] | libgl1-mesa-dev | libgl-dev, libglew-dev, libglu1-mesa-dev | libglu-dev, libgnutls-dev | libgnutls28-dev, libgpg-error-dev, libgtest-dev, libiso9660-dev, libjpeg-dev, liblcms2-dev, liblirc-dev, libltdl-dev, liblzo2-dev, libmicrohttpd-dev, libmysqlclient-dev, libnfs-dev, libogg-dev, libomxil-bellagio-dev [armel], libpcre3-dev, libplist-dev, libpng12-dev | libpng-dev, libpulse-dev, libshairplay-dev, libsmbclient-dev, libspdlog-dev, libsqlite3-dev, libssl-dev, libtag1-dev (>= 1.8) | libtag1x8, libtiff5-dev | libtiff-dev | libtiff4-dev, libtinyxml-dev, libtool, libudev-dev, libva-dev, libvdpau-dev, libvorbis-dev, libxkbcommon-dev, libxmu-dev, libxrandr-dev, libxslt1-dev | libxslt-dev, libxt-dev, waylandpp-dev | netcat, wayland-protocols | wipe, lsb-release, meson (>= 0.47.0), nasm (>= 2.14), ninja-build, python3-dev, python3-pil | python-imaging, python-support | python3-minimal, rapidjson-dev, swig, unzip, uuid-dev, yasm, zip, zlib1g-dev

### 3.1. Build missing dependencies
Some packages may be missing or outdated in older distributions. Notably `crossguid`, `libfmt`, `libspdlog`, `waylandpp`, `wayland-protocols`, etc. are known to be outdated or missing. Fortunately there is an easy way to build individual dependencies with **[Kodi's unified depends build system](../tools/depends/README.md)**.
Expand Down
2 changes: 1 addition & 1 deletion docs/README.Ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ sudo apt install distcc
### 3.2. Get build dependencies manually
If you get a `package not found` type of message with the below command, remove the offending package(s) from the install list and reissue the command. Take a note of the missing dependencies and, after a successful step completion, **[build the missing dependencies manually](README.Linux.md#31-build-missing-dependencies)**.

**NOTE:** Kodi requires a compiler with C++14 support, i.e. gcc >= 4.9 or clang >= 3.4
**NOTE:** Kodi requires a compiler with C++17 support, i.e. gcc >= 7 or clang >= 5

Install build dependencies manually:
```
Expand Down
2 changes: 1 addition & 1 deletion docs/README.openSUSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ sudo zypper ref

If you get a `package not found` type of message with the below command, remove the offending package(s) from the install list and reissue the command. Take a note of the missing dependencies and, after a successful step completion, **[build the missing dependencies manually](#31-build-missing-dependencies)**.

**NOTE:** Kodi requires a compiler with C++14 support, i.e. gcc >= 4.9 or clang >= 3.4
**NOTE:** Kodi requires a compiler with C++17 support, i.e. gcc >= 7 or clang >= 5

Install build dependencies:
```
Expand Down
19 changes: 11 additions & 8 deletions tools/depends/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AC_CONFIG_FILES([target/config.site native/config.site.native Makefile.include t
AC_CANONICAL_HOST

m4_include([m4/xbmc_arch.m4])
m4_include([m4/ax_cxx_compile_stdcxx_14.m4])
m4_include([m4/ax_cxx_compile_stdcxx.m4])
m4_include([m4/ax_compare_version.m4])

# check for not same cpu value
Expand Down Expand Up @@ -245,11 +245,6 @@ AC_PATH_TOOL([CC],[$platform_cc],,$PATH_FOR_HOST)
AC_PATH_TOOL([CXX],[$platform_cxx],,$PATH_FOR_HOST)
AC_PROG_CPP

AX_CXX_COMPILE_STDCXX_14([noext],[mandatory])
c14_flags=$(echo "$CFLAGS" | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ //g')
cxx14_flags=$(echo "$CXXFLAGS" | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ //g')


case $host in
*-*linux-android*)
deps_dir="$use_host-$use_ndk_api-$build_type"
Expand Down Expand Up @@ -566,8 +561,8 @@ if [ ! `mkdir -p $use_tarballs` ]; then
fi

# remove unwanted optimization flags
tmp_cflags=$(echo $c14_flags $platform_cflags | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ \{2,\}//g')
tmp_cxxflags=$(echo $cxx14_flags $platform_cxxflags | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ \{2,\}//g')
tmp_cflags=$(echo $CFLAGS $platform_cflags | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ \{2,\}//g')
tmp_cxxflags=$(echo $CXXFLAGS $platform_cxxflags | sed 's/-O@<:@123@:>@//g;s/-g //g;s/ \{2,\}//g')

release_cflags="-DNDEBUG=1"

Expand Down Expand Up @@ -597,6 +592,12 @@ else
platform_cxxflags="$platform_cxxflags_release"
fi

CXXFLAGS="$platform_cxxflags $platform_includes"
CXX_CACHED="$CXX"
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
CXX="$CXX_CACHED"
platform_cxxflags+=" -std=c++17"

if test "$ffmpeg_options" == "default"; then
ffmpeg_options="$ffmpeg_options_default"
fi
Expand Down Expand Up @@ -663,6 +664,8 @@ echo -e "build type:\t $build_type"
echo -e "toolchain:\t $use_toolchain"
echo -e "cpu:\t\t $use_cpu"
echo -e "host:\t\t $use_host"
echo -e "CC:\t\t $CC"
echo -e "CXX:\t\t $CXX"
echo -e "cflags:\t\t $platform_cflags"
echo -e "cxxflags:\t $platform_cxxflags"
echo -e "ldflags:\t $platform_ldflags"
Expand Down
Loading

0 comments on commit f829348

Please sign in to comment.