dlib icon indicating copy to clipboard operation
dlib copied to clipboard

Build on macOS with LLVM 9.0.1 Clang Compiler

Open dFohlen opened this issue 4 years ago • 1 comments

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

dFohlen avatar Mar 04 '20 11:03 dFohlen

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

davisking avatar Mar 05 '20 13:03 davisking