Skip to content

Build on macOS with LLVM 9.0.1 Clang Compiler #2009

Open

Description

@dFohlen

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

Activity

  1. davisking commented on Mar 5, 2020

    @davisking
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions