mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 18:18:53 +00:00
fcfa6665a9
Usually it's unset, but depends toolchain files set it explicitly for cross-compiling. Don't override preset values. But make sure it's set for all x86 / x86_64 builds, not just Linux. Also make sure -std=c++11 is set for Darwin builds, not all submodules were getting it consistently before.
120 lines
3.5 KiB
CMake
120 lines
3.5 KiB
CMake
# Set the system name, either Darwin, Linux, or Windows
|
|
SET(CMAKE_SYSTEM_NAME @depends@)
|
|
SET(CMAKE_BUILD_TYPE @release_type@)
|
|
|
|
OPTION(STATIC "Link libraries statically" ON)
|
|
OPTION(TREZOR_DEBUG "Main trezor debugging switch" OFF)
|
|
OPTION(BUILD_TESTS "Build tests." OFF)
|
|
|
|
SET(STATIC ON)
|
|
SET(UNBOUND_STATIC ON)
|
|
SET(ARCH "default")
|
|
|
|
SET(BUILD_TESTS @build_tests@)
|
|
SET(TREZOR_DEBUG @build_tests@)
|
|
|
|
# where is the target environment
|
|
SET(CMAKE_FIND_ROOT_PATH @prefix@ /usr)
|
|
|
|
SET(ENV{PKG_CONFIG_PATH} @prefix@/lib/pkgconfig)
|
|
|
|
SET(LRELEASE_PATH @prefix@/native/bin CACHE FILEPATH "path to lrelease" FORCE)
|
|
|
|
SET(Readline_ROOT_DIR @prefix@)
|
|
SET(Readline_INCLUDE_DIR @prefix@/include)
|
|
SET(Readline_LIBRARY @prefix@/lib/libreadline.a)
|
|
SET(Termcap_LIBRARY @prefix@/lib/libtinfo.a)
|
|
|
|
SET(LIBUNWIND_INCLUDE_DIR @prefix@/include)
|
|
SET(LIBUNWIND_LIBRARIES @prefix@/lib/libunwind.a)
|
|
SET(LIBUNWIND_LIBRARY_DIRS @prefix@/lib)
|
|
|
|
SET(LIBUSB-1.0_LIBRARY @prefix@/lib/libusb-1.0.a)
|
|
SET(LIBUDEV_LIBRARY @prefix@/lib/libudev.a)
|
|
|
|
SET(Protobuf_FOUND 1)
|
|
SET(Protobuf_PROTOC_EXECUTABLE @prefix@/native/bin/protoc CACHE FILEPATH "Path to the native protoc")
|
|
SET(Protobuf_INCLUDE_DIR @prefix@/include CACHE PATH "Protobuf include dir")
|
|
SET(Protobuf_INCLUDE_DIRS @prefix@/include CACHE PATH "Protobuf include dir")
|
|
SET(Protobuf_LIBRARY @prefix@/lib/libprotobuf.a CACHE FILEPATH "Protobuf library")
|
|
|
|
SET(ZMQ_INCLUDE_PATH @prefix@/include)
|
|
SET(ZMQ_LIB @prefix@/lib/libzmq.a)
|
|
|
|
SET(Boost_IGNORE_SYSTEM_PATH ON)
|
|
SET(BOOST_ROOT @prefix@)
|
|
SET(BOOST_INCLUDEDIR @prefix@/include)
|
|
SET(BOOST_LIBRARYDIR @prefix@/lib)
|
|
SET(Boost_IGNORE_SYSTEM_PATHS_DEFAULT OFF)
|
|
SET(Boost_NO_SYSTEM_PATHS ON)
|
|
SET(Boost_USE_STATIC_LIBS ON)
|
|
SET(Boost_USE_STATIC_RUNTIME ON)
|
|
|
|
SET(OpenSSL_DIR @prefix@/lib)
|
|
SET(ARCHITECTURE @arch@)
|
|
|
|
# for libraries and headers in the target directories
|
|
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host
|
|
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
|
|
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
|
|
|
|
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR} CACHE STRING "" FORCE)
|
|
|
|
# specify the cross compiler to be used. Darwin uses clang provided by the SDK.
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
SET(CMAKE_C_COMPILER @prefix@/native/bin/clang)
|
|
SET(CMAKE_C_COMPILER_TARGET x86_64-apple-darwin11)
|
|
SET(CMAKE_CXX_COMPILER @prefix@/native/bin/clang++ -stdlib=libc++)
|
|
SET(CMAKE_CXX_COMPILER_TARGET x86_64-apple-darwin11)
|
|
SET(_CMAKE_TOOLCHAIN_PREFIX x86_64-apple-darwin11-)
|
|
SET(APPLE True)
|
|
SET(BUILD_TAG "mac-x64")
|
|
SET(BUILD_64 ON)
|
|
SET(BREW OFF)
|
|
SET(PORT OFF)
|
|
SET(CMAKE_OSX_SYSROOT "@sdk@/MacOSX10.11.sdk/")
|
|
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.08")
|
|
SET(CMAKE_CXX_STANDARD 11)
|
|
SET(CMAKE_OSX_ARCHITECTURES "x86_64")
|
|
SET(LLVM_ENABLE_PIC OFF)
|
|
SET(LLVM_ENABLE_PIE OFF)
|
|
else()
|
|
SET(CMAKE_C_COMPILER @CC@)
|
|
SET(CMAKE_CXX_COMPILER @CXX@)
|
|
endif()
|
|
|
|
if(ARCHITECTURE STREQUAL "arm")
|
|
set(ARCH "armv7-a")
|
|
set(ARM ON)
|
|
set(ARM_ID "armv7-a")
|
|
set(BUILD_64 OFF)
|
|
set(CMAKE_BUILD_TYPE release)
|
|
set(BUILD_TAG "linux-armv7")
|
|
set(ARM7)
|
|
elseif(ARCHITECTURE STREQUAL "aarch64")
|
|
set(ARCH "armv8-a")
|
|
set(ARM ON)
|
|
set(ARM_ID "armv8-a")
|
|
set(BUILD_TAG "linux-armv8")
|
|
set(BUILD_64 ON)
|
|
endif()
|
|
|
|
if(ARCHITECTURE STREQUAL "riscv64")
|
|
set(NO_AES ON)
|
|
set(ARCH "rv64imafdc")
|
|
endif()
|
|
|
|
if(ARCHITECTURE STREQUAL "i686")
|
|
SET(ARCH_ID "i386")
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
SET(LINUX_32 ON)
|
|
endif()
|
|
endif()
|
|
|
|
if(ARCHITECTURE STREQUAL "x86_64")
|
|
SET(ARCH_ID "x86_64")
|
|
endif()
|
|
|
|
#Create a new global cmake flag that indicates building with depends
|
|
set (DEPENDS true)
|