Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on macOS with LLVM 9.0.1 Clang Compiler #2009

Open
dFohlen opened this issue Mar 4, 2020 · 1 comment
Open

Build on macOS with LLVM 9.0.1 Clang Compiler #2009

dFohlen opened this issue Mar 4, 2020 · 1 comment
Labels

Comments

@dFohlen
Copy link

dFohlen commented Mar 4, 2020

Hi @davisking,

building dlib 19.19 on macOS with LLVM 9.0.1 Clang complier fails, because of the target_compile_features command which was introduced in CMake version 3.1.

Expected Behavior

Build and install dlib 19.19 on macOS with default options.

Current Behavior

Build fails here

Steps to Reproduce

  1. Download dlib 19.19
  2. Go into the examples folder and type: mkdir build; cd build; cmake .. ; cmake --build .
  3. Build fails here with:
CMake Error at dlib/cmake_utils/use_cpp_11.cmake:74 (target_compile_features):
  target_compile_features no known features for CXX compiler

  "Clang"

  version 9.0.1.
Call Stack (most recent call first):
  dlib/CMakeLists.txt:858 (enable_cpp11_for_target)


-- Building a C++11 test project to see if your compiler supports C++11
-- C++11 activated.
-- Configuring incomplete, errors occurred!

Suggestion

Adding this:

if(POLICY CMP0025)
  cmake_policy(SET CMP0025 NEW)
endif()

between here solves the problem. I tried also adding this into the use_cpp_11.cmake but has no effect.

  • Version:
    dlib 19.19
  • Where did you get dlib:
    Downloaded source from GitHub
  • Platform:
    macOS (Catalina 10.15.2 (19C57))
  • Compiler:
    LLVM 9.0.1 Clang
    CMake 3.16.4
@davisking
Copy link
Owner

Thanks for reporting this. Do you want to make pull request with the change? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants