summaryrefslogtreecommitdiff
path: root/libs/luajit-cmake/Utils/windows.toolchain.cmake
blob: e3b937ba42d00f21cb957dc330b912dd7a23dc6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
SET(CMAKE_SYSTEM_NAME Windows)

IF(DEFINED ENV{USE_64BITS})
  SET(USE_64BITS $ENV{USE_64BITS})
ENDIF()

IF(USE_64BITS OR CMAKE_SIZEOF_VOID_P STREQUAL 8)
  SET(CROSSCOMPILER x86_64-w64-mingw32-)
ELSE()
  SET(CROSSCOMPILER i686-w64-mingw32-)
ENDIF()

IF($ENV{CROSSCOMPILER})
  SET(CROSSCOMPILER $ENV{CROSSCOMPILER})
ENDIF()


SET(CMAKE_C_COMPILER   ${CROSSCOMPILER}gcc)
SET(CMAKE_CXX_COMPILER ${CROSSCOMPILER}g++)
SET(CMAKE_STRIP        ${CROSSCOMPILER}strip)
SET(CMAKE_RC_COMPILER  ${CROSSCOMPILER}windres)


IF($ENV{CMAKE_FIND_ROOT_PATH})
  SET(CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH})
ELSE()
  EXECUTE_PROCESS(COMMAND
    ${CMAKE_C_COMPILER} --print-sysroot OUTPUT_VARIABLE SYSROOT)
  IF($ENV{SYSROOT})
    SET(SYSROOT $ENV{SYSROOT})
  ENDIF()
  SET(CMAKE_FIND_ROOT_PATH ${SYSROOT})
ENDIF()

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)