Permalink
Browse files

CMake: let CMake handle the C++ standard setting if target_compile_fe…

…atures() is used

This raises the required CMake version for this branch to get a better error
message. target_compile_features() was introduced in CMake 3.1.
  • Loading branch information...
DerDakon authored and Rolf Eike Beer committed Oct 20, 2017
1 parent 02f726b commit ca7e60edd370949cfb2adb83ca0b532bb3fdc441
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/CMakeLists.txt
View
@@ -249,10 +249,11 @@ if (use_libclang)
find_package(LLVM REQUIRED CONFIG)
find_package(Clang REQUIRED CONFIG)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
cmake_minimum_required(VERSION 3.1)
target_compile_features(_doxygen PRIVATE cxx_alignof)
target_compile_features(doxygen PRIVATE cxx_alignof)
target_compile_options(_doxygen PRIVATE -stdlib=libc++ -std=c++11)
target_compile_options(doxygen PRIVATE -stdlib=libc++ -std=c++11)
target_compile_options(_doxygen PRIVATE -stdlib=libc++)
target_compile_options(doxygen PRIVATE -stdlib=libc++)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_compile_options(_doxygen PRIVATE -std=c++11)
target_compile_options(doxygen PRIVATE -std=c++11)

0 comments on commit ca7e60e

Please sign in to comment.