1# Gets string/platform information about the specific compiler
2# Defines:
3#  LCB_CC_STRING for the C compiler string (i.e. "msvc", "mingw")
4#  LCB_ARCH_STRING for the target architecture, e.g. "x86"
5
6# Figure out how we're building!
7IF(MSVC)
8    IF(CMAKE_CL_64)
9        SET(LCB_ARCH_STRING "amd64")
10    ELSE()
11        SET(LCB_ARCH_STRING "x86")
12    ENDIF(CMAKE_CL_64)
13
14    IF(MSVC80)
15        SET(LCB_CC_STRING "vs8")
16    ELSEIF(MSVC90)
17        SET(LCB_CC_STRING "vc9")
18    ELSEIF(MSVC_VERSION EQUAL 1600)
19        SET(LCB_CC_STRING "vc10")
20    ELSEIF(MSVC_VERSION EQUAL 1700)
21        SET(LCB_CC_STRING "vc11")
22    ELSEIF(MSVC_VERSION EQUAL 1800)
23        SET(LCB_CC_STRING "vc12")
24    ENDIF()
25ELSE()
26    IF(UNIX)
27        SET(LCB_CC_STRING "gcc")
28        EXECUTE_PROCESS(
29            COMMAND
30                uname -m
31            COMMAND
32                tr -d '\n'
33            OUTPUT_VARIABLE
34                LCB_ARCH_STRING)
35    ELSE()
36        IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
37            SET(LCB_ARCH_STRING "amd64")
38        ELSE()
39            SET(LCB_ARCH_STRING "x86")
40        ENDIF()
41        SET(LCB_CC_STRING "mingw")
42    ENDIF()
43ENDIF()
44