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    ELSEIF(MSVC_VERSION EQUAL 1900)
25        SET(LCB_CC_STRING "vc14")
26    ELSEIF(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919)
27        SET(LCB_CC_STRING "vc15")
28    ELSEIF(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS_EQUAL 1929)
29        SET(LCB_CC_STRING "vc16")
30    ENDIF()
31ELSE()
32    IF(UNIX)
33        SET(LCB_CC_STRING "gcc")
34        EXECUTE_PROCESS(
35            COMMAND
36                uname -m
37            COMMAND
38                tr -d '\n'
39            OUTPUT_VARIABLE
40                LCB_ARCH_STRING)
41    ELSE()
42        IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
43            SET(LCB_ARCH_STRING "amd64")
44        ELSE()
45            SET(LCB_ARCH_STRING "x86")
46        ENDIF()
47        SET(LCB_CC_STRING "mingw")
48    ENDIF()
49ENDIF()
50