mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
896 B
CMake
27 lines
896 B
CMake
set(CMAKE_SYSTEM_NAME Windows)
|
|
set(TOOLCHAIN_PREFIX i686-w64-mingw32)
|
|
|
|
add_definitions("-DWINNT_CROSS_COMPILE")
|
|
|
|
# target environment on the build host system
|
|
# second one is for non-root installs
|
|
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX} /opt/mingw32 /home/$ENV{USER}/mingw32 /home/$ENV{USER}/mingw32/${TOOLCHAIN_PREFIX})
|
|
|
|
# modify default behavior of FIND_XXX() commands
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
# cross compilers to use
|
|
if($ENV{COMPILER} MATCHES "clang")
|
|
set(USING_CLANG ON)
|
|
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-clang)
|
|
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-clang++)
|
|
else()
|
|
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc-posix)
|
|
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++-posix)
|
|
endif()
|
|
|
|
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
|
set(WOW64_CROSS_COMPILE ON)
|