cmake_modules/FindClang.cmake
branchwebgl
changeset 8111 4307de8780fa
parent 8109 b5cd8cad2d86
child 8113 0ad9c42dca7c
equal deleted inserted replaced
8109:b5cd8cad2d86 8111:4307de8780fa
    11 IF (CLANG_EXECUTABLE)
    11 IF (CLANG_EXECUTABLE)
    12     EXEC_PROGRAM(${CLANG_EXECUTABLE} ARGS "-v" OUTPUT_VARIABLE CLANG_VERSION_FULL)
    12     EXEC_PROGRAM(${CLANG_EXECUTABLE} ARGS "-v" OUTPUT_VARIABLE CLANG_VERSION_FULL)
    13 
    13 
    14     STRING(REGEX MATCH "[0-9]+\\.[0-9]+" CLANG_VERSION_LONG "${CLANG_VERSION_FULL}")
    14     STRING(REGEX MATCH "[0-9]+\\.[0-9]+" CLANG_VERSION_LONG "${CLANG_VERSION_FULL}")
    15     STRING(REGEX REPLACE "([0-9]+\\.[0-9]+)" "\\1" CLANG_VERSION "${CLANG_VERSION_LONG}")
    15     STRING(REGEX REPLACE "([0-9]+\\.[0-9]+)" "\\1" CLANG_VERSION "${CLANG_VERSION_LONG}")
    16 
       
    17     # Required that LLVM/Clang version is >= 3.0
       
    18     IF (CLANG_VERSION VERSION_GREATER 3.0 OR CLANG_VERSION VERSION_EQUAL 3.0)
       
    19         MESSAGE(STATUS "Found CLANG: ${CLANG_EXECUTABLE} (version ${CLANG_VERSION})")
       
    20     ELSE()
       
    21         MESSAGE(FATAL_ERROR "Necessary LLVM/Clang version not found (version >= 3.0 required)")
       
    22     ENDIF()
       
    23 ELSE()
    16 ELSE()
    24     MESSAGE(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)")
    17     MESSAGE(FATAL_ERROR "No LLVM/Clang compiler found (required for engine_c target)")
    25 ENDIF()
    18 ENDIF()
    26 
    19 
    27 SET(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})
    20 SET(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})