2014-03-02 20:51:42 +00:00
|
|
|
|
|
|
|
if(NOT ARCH)
|
|
|
|
set(ARCH i386)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# Choose the right MinGW toolchain prefix
|
2020-05-26 18:24:02 +00:00
|
|
|
if(NOT DEFINED MINGW_TOOLCHAIN_PREFIX)
|
2014-03-02 20:51:42 +00:00
|
|
|
if(ARCH STREQUAL "i386")
|
|
|
|
|
|
|
|
if(CMAKE_HOST_WIN32)
|
|
|
|
set(MINGW_TOOLCHAIN_PREFIX "" CACHE STRING "MinGW Toolchain Prefix")
|
|
|
|
else()
|
2020-06-24 18:41:44 +00:00
|
|
|
set(MINGW_TOOLCHAIN_PREFIX "i686-w64-mingw32-" CACHE STRING "MinGW-W64 Toolchain Prefix")
|
2014-03-02 20:51:42 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
elseif(ARCH STREQUAL "amd64")
|
|
|
|
set(MINGW_TOOLCHAIN_PREFIX "x86_64-w64-mingw32-" CACHE STRING "MinGW Toolchain Prefix")
|
|
|
|
elseif(ARCH STREQUAL "arm")
|
|
|
|
set(MINGW_TOOLCHAIN_PREFIX "arm-mingw32ce-" CACHE STRING "MinGW Toolchain Prefix")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-05-26 18:24:02 +00:00
|
|
|
if(NOT DEFINED MINGW_TOOLCHAIN_SUFFIX)
|
2014-03-02 20:51:42 +00:00
|
|
|
set(MINGW_TOOLCHAIN_SUFFIX "" CACHE STRING "MinGW Toolchain Suffix")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_CCACHE)
|
|
|
|
set(CCACHE "ccache" CACHE STRING "ccache")
|
|
|
|
else()
|
|
|
|
set(CCACHE "" CACHE STRING "ccache")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# The name of the target operating system
|
|
|
|
set(CMAKE_SYSTEM_NAME Windows)
|
|
|
|
set(CMAKE_SYSTEM_PROCESSOR i686)
|
|
|
|
|
|
|
|
# Which tools to use
|
|
|
|
set(CMAKE_C_COMPILER clang)
|
2014-09-09 12:14:52 +00:00
|
|
|
set(CMAKE_CXX_COMPILER ${MINGW_TOOLCHAIN_PREFIX}g++${MINGW_TOOLCHAIN_SUFFIX})
|
2014-03-02 20:51:42 +00:00
|
|
|
set(CMAKE_ASM_COMPILER ${MINGW_TOOLCHAIN_PREFIX}gcc${MINGW_TOOLCHAIN_SUFFIX})
|
|
|
|
set(CMAKE_ASM_COMPILER_ID "GNU")
|
|
|
|
set(CMAKE_MC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windmc)
|
|
|
|
set(CMAKE_RC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windres)
|
|
|
|
set(CMAKE_DLLTOOL ${MINGW_TOOLCHAIN_PREFIX}dlltool)
|
|
|
|
|
2014-09-07 12:33:13 +00:00
|
|
|
if(CMAKE_HOST_WIN32)
|
|
|
|
set(CMAKE_AR ar)
|
2014-03-02 20:51:42 +00:00
|
|
|
endif()
|
2014-09-07 12:33:13 +00:00
|
|
|
|
|
|
|
set(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_AR} crT <TARGET> <LINK_FLAGS> <OBJECTS>")
|
2014-03-02 20:51:42 +00:00
|
|
|
set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
|
|
|
|
set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY})
|
|
|
|
|
|
|
|
# Don't link with anything by default unless we say so
|
2014-09-10 15:56:48 +00:00
|
|
|
set(CMAKE_C_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C Libraries")
|
2014-03-02 20:51:42 +00:00
|
|
|
|
|
|
|
#MARK_AS_ADVANCED(CLEAR CMAKE_CXX_STANDARD_LIBRARIES)
|
|
|
|
set(CMAKE_CXX_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C++ Libraries")
|
|
|
|
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nostdlib -Wl,--enable-auto-image-base,--disable-auto-import")
|
2019-03-20 13:19:48 +00:00
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-nostdlib -Wl,--enable-auto-image-base,--disable-auto-import")
|