mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-07 15:20:31 +00:00
231674e5a5
We set CMAKE_CROSSCOMPILE in a few places, but that is just a typo for CMAKE_CROSSCOMPILING. However we don't need to set it at all: cmake does so automatically whenever CMAKE_SYSTEM_NAME is set (which is why our cross compiling actually works currently.)
27 lines
863 B
CMake
27 lines
863 B
CMake
set(CMAKE_SYSTEM_VERSION 5.0)
|
|
|
|
# target environment on the build host system
|
|
# second one is for non-root installs
|
|
set(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PATHS})
|
|
|
|
add_definitions("-DWINNT_CROSS_COMPILE")
|
|
|
|
# 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)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE 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${TOOLCHAIN_SUFFIX})
|
|
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++${TOOLCHAIN_SUFFIX})
|
|
endif()
|
|
|
|
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
|
set(ARCH_TRIPLET ${CROSS_TARGET})
|