Skip to content

Commit

Permalink
CMake: let CMake handle the C++ standard setting if target_compile_fe…
Browse files Browse the repository at this point in the history
…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 ca7e60e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ca7e60e

Please sign in to comment.