| 1 |
option(COMPILER_GCC "gcc" ON) |
| 2 |
option(COMPILER_CLANG "clang" OFF) |
| 3 |
option(COMPILER_64BIT "64bit" OFF) |
| 4 |
|
| 5 |
message(STATUS "CMAKE_HOST_SYSTEM_NAME=${CMAKE_HOST_SYSTEM_NAME}") |
| 6 |
if(COMPILER_GCC) |
| 7 |
set(COMPILER mingw) |
| 8 |
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") |
| 9 |
if(COMPILER_64BIT) |
| 10 |
set(COMPILER_FRIENDLY mingw_gcc_x64) |
| 11 |
set(ENV{PATH} "C:/msys64/mingw64/bin;C:/msys64/usr/bin") |
| 12 |
else(COMPILER_64BIT) |
| 13 |
set(COMPILER_FRIENDLY mingw_gcc) |
| 14 |
set(ENV{PATH} "C:/msys64/mingw32/bin;C:/msys64/usr/bin") |
| 15 |
endif(COMPILER_64BIT) |
| 16 |
set(CMAKE_C_COMPILER gcc) |
| 17 |
set(CMAKE_CXX_COMPILER g++) |
| 18 |
set(CMAKE_RC_COMPILER windres) |
| 19 |
else() |
| 20 |
list(APPEND GENERATE_OPTIONS "-DCMAKE_SYSTEM_NAME=Windows") |
| 21 |
if(COMPILER_64BIT) |
| 22 |
set(COMPILER_FRIENDLY mingw_gcc_x64) |
| 23 |
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) |
| 24 |
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) |
| 25 |
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) |
| 26 |
else(COMPILER_64BIT) |
| 27 |
set(COMPILER_FRIENDLY mingw_gcc) |
| 28 |
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) |
| 29 |
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) |
| 30 |
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) |
| 31 |
endif(COMPILER_64BIT) |
| 32 |
endif() |
| 33 |
elseif(COMPILER_CLANG) |
| 34 |
set(COMPILER mingw) |
| 35 |
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") |
| 36 |
if(COMPILER_64BIT) |
| 37 |
set(COMPILER_FRIENDLY mingw_clang_x64) |
| 38 |
set(ENV{PATH} "C:/msys64/mingw64/bin;C:/msys64/usr/bin") |
| 39 |
else(COMPILER_64BIT) |
| 40 |
set(COMPILER_FRIENDLY mingw_clang) |
| 41 |
set(ENV{PATH} "C:/msys64/mingw32/bin;C:/msys64/usr/bin") |
| 42 |
endif(COMPILER_64BIT) |
| 43 |
set(CMAKE_C_COMPILER clang) |
| 44 |
set(CMAKE_CXX_COMPILER clang++) |
| 45 |
set(CMAKE_RC_COMPILER windres) |
| 46 |
else() |
| 47 |
list(APPEND GENERATE_OPTIONS "-DCMAKE_SYSTEM_NAME=Windows") |
| 48 |
if(COMPILER_64BIT) |
| 49 |
set(COMPILER_FRIENDLY mingw_clang_x64) |
| 50 |
set(CMAKE_C_COMPILER x86_64-w64-mingw32-clang) |
| 51 |
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-clang++) |
| 52 |
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) |
| 53 |
else(COMPILER_64BIT) |
| 54 |
set(COMPILER_FRIENDLY mingw_clang) |
| 55 |
set(CMAKE_C_COMPILER i686-w64-mingw32-clang) |
| 56 |
set(CMAKE_CXX_COMPILER i686-w64-mingw32-clang++) |
| 57 |
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) |
| 58 |
endif() |
| 59 |
endif() |
| 60 |
else() |
| 61 |
message(FATAL_ERROR "check compiler") |
| 62 |
endif() |
| 63 |
|
| 64 |
list(APPEND GENERATE_OPTIONS "-G" "Unix Makefiles") |
| 65 |
#list(APPEND GENERATE_OPTIONS "-G" Ninja) |
| 66 |
list(APPEND GENERATE_OPTIONS "-DCMAKE_BUILD_TYPE=Release") |
| 67 |
set(BUILD_DIR "${CMAKE_CURRENT_LIST_DIR}/../build_${COMPILER_FRIENDLY}_appveyor") |
| 68 |
list(APPEND BUILD_TOOL_OPTIONS "--" "-j") |
| 69 |
|
| 70 |
include(${CMAKE_CURRENT_LIST_DIR}/build_appveyor.cmake) |