2020-01-17 11:51:21 +01:00
cmake_minimum_required ( VERSION 3.5 )
2018-05-09 02:01:27 +02:00
project ( monero-gui )
2019-09-29 17:29:22 +02:00
message ( STATUS "Initiating compile using CMake ${CMAKE_VERSION}" )
set ( VERSION_MAJOR "14" )
set ( VERSION_MINOR "0" )
set ( VERSION_REVISION "3" )
set ( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}" )
2020-05-15 04:24:14 +02:00
option ( STATIC "Link libraries statically, requires static Qt" )
2018-05-09 02:01:27 +02:00
option ( USE_DEVICE_TREZOR ON )
option ( ENABLE_PASS_STRENGTH_METER "Disable zxcvbn" OFF )
option ( WITH_SCANNER "Enable webcam QR scanner" OFF )
option ( DEV_MODE "Checkout latest monero master on build" OFF )
2019-09-29 17:29:22 +02:00
list ( INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake" )
set ( CMAKE_AUTOMOC ON )
set ( CMAKE_AUTORCC ON )
set ( CMAKE_AUTOUIC ON )
if ( DEBUG )
set ( CMAKE_VERBOSE_MAKEFILE ON )
endif ( )
2018-05-09 02:01:27 +02:00
set ( BUILD_GUI_DEPS ON )
set ( ARCH "x86-64" )
set ( BUILD_64 ON )
set ( INSTALL_VENDORED_LIBUNBOUND=ON )
2019-11-29 11:09:00 +01:00
function ( add_c_flag_if_supported flag var )
string ( REPLACE "-" "_" supported ${ flag } _c )
check_c_compiler_flag ( ${ flag } ${ supported } )
if ( ${ ${supported } } )
set ( ${ var } "${${var}} ${flag}" PARENT_SCOPE )
endif ( )
endfunction ( )
function ( add_cxx_flag_if_supported flag var )
string ( REPLACE "-" "_" supported ${ flag } _cxx )
check_cxx_compiler_flag ( ${ flag } ${ supported } )
if ( ${ ${supported } } )
set ( ${ var } "${${var}} ${flag}" PARENT_SCOPE )
endif ( )
endfunction ( )
function ( add_linker_flag_if_supported flag var )
string ( REPLACE "-" "_" supported ${ flag } _ld )
string ( REPLACE "," "_" supported ${ flag } _ld )
check_linker_flag ( ${ flag } ${ supported } )
if ( ${ ${supported } } )
set ( ${ var } "${${var}} ${flag}" PARENT_SCOPE )
endif ( )
endfunction ( )
2018-05-09 02:01:27 +02:00
find_package ( Git )
if ( GIT_FOUND )
if ( NOT DEV_MODE )
find_package ( Git )
function ( check_submodule relative_path )
execute_process ( COMMAND git rev-parse "HEAD" WORKING_DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } / ${ relative_path } OUTPUT_VARIABLE localHead )
execute_process ( COMMAND git rev-parse "HEAD:${relative_path}" WORKING_DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } OUTPUT_VARIABLE checkedHead )
string ( COMPARE EQUAL "${localHead}" "${checkedHead}" upToDate )
if ( upToDate )
message ( STATUS "Submodule '${relative_path}' is up-to-date" )
else ( )
message ( FATAL_ERROR "Submodule '${relative_path}' is not using the checked head. Please update all submodules with\ngit submodule update --init --force\nor run cmake with -DMANUAL_SUBMODULES=1,\n or if you want to build from latest master run cmake with -DEV_MODE,\n or run make devmode" )
endif ( )
endfunction ( )
message ( STATUS "Checking submodules" )
check_submodule ( monero )
else ( )
execute_process ( COMMAND cd monero && git checkout origin/master )
endif ( )
endif ( )
2020-05-15 04:24:14 +02:00
set ( STATIC_OLD ${ STATIC } )
set ( STATIC ON CACHE BOOL "Link libraries statically" FORCE )
2018-05-09 02:01:27 +02:00
add_subdirectory ( monero )
2020-05-15 04:24:14 +02:00
set ( STATIC ${ STATIC_OLD } CACHE BOOL "Link libraries statically" FORCE )
2018-05-09 02:01:27 +02:00
set_property ( TARGET wallet_merged PROPERTY FOLDER "monero" )
2019-10-05 15:11:18 +02:00
get_directory_property ( ARCH_WIDTH DIRECTORY "monero" DEFINITION ARCH_WIDTH )
2019-09-29 17:29:22 +02:00
2019-12-19 15:43:31 +01:00
if ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
add_definitions ( -DQT_NO_DEBUG )
endif ( )
2019-09-29 17:29:22 +02:00
if ( STATIC )
2019-12-24 12:19:00 +01:00
message ( STATUS "Initiating static build" )
set ( Boost_USE_STATIC_LIBS ON )
set ( Boost_USE_STATIC_RUNTIME ON )
2019-11-28 13:05:07 +01:00
set ( CMAKE_FIND_LIBRARY_SUFFIXES ".a" )
add_definitions ( -DMONERO_GUI_STATIC )
2019-09-29 17:29:22 +02:00
endif ( )
# Include password strength library
2018-05-09 02:01:27 +02:00
if ( ENABLE_PASS_STRENGTH_METER )
2019-10-02 17:11:59 +02:00
message ( STATUS "Buildin with pass strength meter support." )
2018-05-09 02:01:27 +02:00
else ( )
add_definitions ( -DDISABLE_PASS_STRENGTH_METER )
endif ( )
2019-09-29 17:29:22 +02:00
include ( CheckTrezor ) # Trezor support check
include ( CMakePackageConfigHelpers )
2018-05-09 02:01:27 +02:00
# force version update
function ( monero_gui_add_library_with_deps )
cmake_parse_arguments ( MONERO_ADD_LIBRARY "" "NAME" "DEPENDS;SOURCES" ${ ARGN } )
source_group ( "${MONERO_ADD_LIBRARY_NAME}" FILES ${ MONERO_ADD_LIBRARY_SOURCES } )
# Define a ("virtual") object library and an actual library that links those
# objects together. The virtual libraries can be arbitrarily combined to link
# any subset of objects into one library archive. This is used for releasing
# libwallet, which combines multiple components.
set ( objlib obj_ ${ MONERO_ADD_LIBRARY_NAME } )
add_library ( ${ objlib } OBJECT ${ MONERO_ADD_LIBRARY_SOURCES } )
add_library ( "${MONERO_ADD_LIBRARY_NAME}" $< TARGET_OBJECTS:${objlib} > )
if ( MONERO_ADD_LIBRARY_DEPENDS )
add_dependencies ( ${ objlib } ${ MONERO_ADD_LIBRARY_DEPENDS } )
endif ( )
set_property ( TARGET "${MONERO_ADD_LIBRARY_NAME}" PROPERTY FOLDER "libs" )
target_compile_definitions ( ${ objlib }
P R I V A T E $ < T A R G E T _ P R O P E R T Y : $ { M O N E R O _ A D D _ L I B R A R Y _ N A M E } , I N T E R F A C E _ C O M P I L E _ D E F I N I T I O N S > )
endfunction ( )
function ( monero_gui_add_library name )
monero_gui_add_library_with_deps ( NAME "${name}" SOURCES ${ ARGN } )
endfunction ( )
include_directories ( ${ EASYLOGGING_INCLUDE } )
link_directories ( ${ EASYLOGGING_LIBRARY_DIRS } )
include ( VersionGui )
monero_gui_add_library ( gui_version SOURCES version.js DEPENDS genversiongui )
2019-09-29 17:29:22 +02:00
2018-05-09 02:01:27 +02:00
message ( STATUS "${CMAKE_MODULE_PATH}" )
2019-09-29 17:29:22 +02:00
# OpenSSL
find_package ( OpenSSL REQUIRED )
message ( STATUS "OpenSSL: Version ${OPENSSL_VERSION}" )
message ( STATUS "OpenSSL: include dir at ${OPENSSL_INCLUDE_DIR}" )
message ( STATUS "OpenSSL: libraries at ${OPENSSL_LIBRARIES} ${OPENSSL_SSL_LIBRARIES}" )
# Zbar (for QR scanner)
2018-05-09 02:01:27 +02:00
if ( WITH_SCANNER )
add_definitions ( -DWITH_SCANNER )
find_package ( ZBar0 )
message ( STATUS "libzbar: include dir at ${ZBAR_INCLUDE_DIR}" )
message ( STATUS "libzbar: libraries at ${ZBAR_LIBRARIES}" )
endif ( )
2019-09-29 17:29:22 +02:00
# Sodium
2018-05-09 02:01:27 +02:00
find_library ( SODIUM_LIBRARY sodium )
message ( STATUS "libsodium: libraries at ${SODIUM_LIBRARY}" )
2019-09-29 17:29:22 +02:00
# LibUSB
find_package ( LibUSB )
message ( STATUS "libusb: include dir at ${LibUSB_INCLUDE_DIRS}" )
message ( STATUS "libusb: libraries at ${LibUSB_LIBRARIES}" )
# HIDApi
find_package ( HIDAPI REQUIRED )
message ( STATUS "libhidapi: include dir at ${HIDAPI_INCLUDE_DIRS}" )
message ( STATUS "libhidapi: libraries at ${HIDAPI_LIBRARIES}" )
# Boost
2018-05-09 02:01:27 +02:00
if ( DEBUG )
set ( Boost_DEBUG ON )
endif ( )
2019-09-29 17:29:22 +02:00
find_package ( Boost 1.62 REQUIRED COMPONENTS
s y s t e m
f i l e s y s t e m
t h r e a d
d a t e _ t i m e
c h r o n o
r e g e x
s e r i a l i z a t i o n
p r o g r a m _ o p t i o n s
l o c a l e )
2020-01-17 11:38:14 +01:00
if ( UNIX AND NOT APPLE )
2018-05-09 02:01:27 +02:00
find_package ( X11 REQUIRED )
message ( STATUS "X11_FOUND = ${X11_FOUND}" )
message ( STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}" )
message ( STATUS "X11_LIBRARIES = ${X11_LIBRARIES}" )
include_directories ( ${ X11_INCLUDE_DIR } )
link_directories ( ${ X11_LIBRARIES } )
if ( STATIC )
find_library ( XCB_LIBRARY xcb )
message ( STATUS "Found xcb library: ${XCB_LIBRARY}" )
endif ( )
endif ( )
2019-10-02 17:11:59 +02:00
if ( MINGW )
string ( REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}" )
message ( STATUS "MSYS location: ${msys2_install_path}" )
set ( CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include" )
2019-10-07 14:07:09 +02:00
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/Qt/labs/folderlistmodel" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/Qt/labs/settings" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtGraphicalEffects" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtGraphicalEffects/private" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtMultimedia" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick.2" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Controls" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Controls.2" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Dialogs" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Dialogs/Private" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Layouts" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/PrivateWidgets" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Templates.2" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/Window.2" )
link_directories ( "${msys2_install_path}/mingw${ARCH_WIDTH}/qml/QtQuick/XmlListModel" )
2019-10-02 17:11:59 +02:00
# This is necessary because otherwise CMake will make Boost libraries -lfoo
# rather than a full path. Unfortunately, this makes the shared libraries get
# linked due to a bug in CMake which misses putting -static flags around the
# -lfoo arguments.
set ( DEFLIB ${ msys2_install_path } /mingw ${ ARCH_WIDTH } /lib )
list ( REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${ DEFLIB } )
list ( REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES ${ DEFLIB } )
endif ( )
2019-10-07 14:07:09 +02:00
set ( QT5_LIBRARIES
Q t 5 C o r e
Q t 5 Q u i c k
Q t 5 Q u i c k C o n t r o l s 2
Q t 5 W i d g e t s
Q t 5 G u i
Q t 5 N e t w o r k
Q t 5 Q m l
Q t 5 M u l t i m e d i a
Q t 5 X m l
Q t 5 X m l P a t t e r n s
Q t 5 S v g
)
2020-05-15 04:25:51 +02:00
# TODO: drop this once we switch to Qt 5.14+
find_package ( Qt5QmlModels QUIET )
if ( Qt5QmlModels_FOUND )
list ( APPEND QT5_LIBRARIES Qt5QmlModels )
endif ( )
2019-10-07 14:07:09 +02:00
foreach ( QT5_MODULE ${ QT5_LIBRARIES } )
find_package ( ${ QT5_MODULE } REQUIRED )
endforeach ( )
find_package ( PkgConfig )
if ( PKGCONFIG_FOUND )
pkg_check_modules ( QT5_PKG_CONFIG ${ QT5_LIBRARIES } )
if ( QT5_PKG_CONFIG_FOUND )
set ( QT5_PKG_CONFIG "QT5_PKG_CONFIG" )
if ( STATIC )
set ( QT5_PKG_CONFIG "${QT5_PKG_CONFIG}_STATIC" )
endif ( )
set ( QT5_LIBRARIES ${ ${QT5_PKG_CONFIG } _LIBRARIES} ${ ${QT5_PKG_CONFIG } _LDFLAGS_OTHER} )
include_directories ( ${ ${QT5_PKG_CONFIG } _INCLUDE_DIRS} )
link_directories ( ${ ${QT5_PKG_CONFIG } _LIBRARY_DIRS} )
endif ( )
endif ( )
list ( APPEND QT5_LIBRARIES
$ { Q t 5 G u i _ P L U G I N S }
$ { Q t 5 S v g _ P L U G I N S }
$ { Q t 5 Q m l _ P L U G I N S }
$ { Q t 5 N e t w o r k _ P L U G I N S }
)
if ( STATIC )
set ( QT5_LIBRARIES
q t q u i c k c o n t r o l s 2 p l u g i n # has to be the first one, depends on Qt5QuickControls2
$ { Q T 5 _ L I B R A R I E S }
d e c l a r a t i v e _ m u l t i m e d i a
d i a l o g p l u g i n
d i a l o g s p r i v a t e p l u g i n
q m l f o l d e r l i s t m o d e l p l u g i n
q m l s e t t i n g s p l u g i n
q m l x m l l i s t m o d e l p l u g i n
q q u i c k l a y o u t s p l u g i n
Q t 5 E v e n t D i s p a t c h e r S u p p o r t
Q t 5 F o n t D a t a b a s e S u p p o r t
Q t 5 M u l t i m e d i a Q u i c k _ p
Q t 5 P a c k e t P r o t o c o l
Q t 5 T h e m e S u p p o r t
q t g r a p h i c a l e f f e c t s p l u g i n
q t g r a p h i c a l e f f e c t s p r i v a t e
q t q u i c k 2 p l u g i n
q t q u i c k c o n t r o l s p l u g i n
q t q u i c k t e m p l a t e s 2 p l u g i n
w i d g e t s p l u g i n
w i n d o w p l u g i n
)
if ( MINGW )
2019-11-29 11:09:00 +01:00
list ( APPEND QT5_LIBRARIES qtfreetype )
2019-10-07 14:07:09 +02:00
if ( CMAKE_BUILD_TYPE STREQUAL "Debug" )
list ( APPEND QT5_LIBRARIES D3D11 Dwrite D2d1 )
endif ( )
endif ( )
endif ( )
2019-09-29 17:29:22 +02:00
message ( STATUS "Using Boost include dir at ${Boost_INCLUDE_DIRS}" )
message ( STATUS "Using Boost libraries at ${Boost_LIBRARIES}" )
2019-10-02 17:11:59 +02:00
include_directories ( SYSTEM ${ Boost_INCLUDE_DIRS } )
if ( MINGW )
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj" )
set ( EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt )
if ( DEPENDS )
set ( ICU_LIBRARIES icuio icui18n icuuc icudata icutu iconv )
else ( )
set ( ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv )
endif ( )
elseif ( APPLE OR OPENBSD OR ANDROID )
set ( EXTRA_LIBRARIES "" )
elseif ( FREEBSD )
set ( EXTRA_LIBRARIES execinfo )
elseif ( DRAGONFLY )
find_library ( COMPAT compat )
set ( EXTRA_LIBRARIES execinfo ${ COMPAT } )
elseif ( CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)" )
set ( EXTRA_LIBRARIES socket nsl resolv )
elseif ( NOT MSVC AND NOT DEPENDS )
find_library ( RT rt )
set ( EXTRA_LIBRARIES ${ RT } )
endif ( )
list ( APPEND EXTRA_LIBRARIES ${ CMAKE_DL_LIBS } )
2019-10-02 22:33:48 +02:00
if ( APPLE )
include_directories ( SYSTEM /usr/include/malloc )
if ( POLICY CMP0042 )
cmake_policy ( SET CMP0042 NEW )
endif ( )
endif ( )
if ( APPLE AND NOT IOS )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -fvisibility=default -std=c++11" )
endif ( )
if ( APPLE )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -DGTEST_HAS_TR1_TUPLE=0" )
endif ( )
2019-11-29 11:09:00 +01:00
# warnings
2020-02-16 03:52:53 +01:00
add_c_flag_if_supported ( -Werror C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -Werror CXX_SECURITY_FLAGS )
2019-11-29 11:09:00 +01:00
add_c_flag_if_supported ( -Wformat C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -Wformat CXX_SECURITY_FLAGS )
add_c_flag_if_supported ( -Wformat-security C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -Wformat-security CXX_SECURITY_FLAGS )
# -fstack-protector
if ( NOT OPENBSD AND NOT ( WIN32 AND ( CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1 ) ) )
add_c_flag_if_supported ( -fstack-protector C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -fstack-protector CXX_SECURITY_FLAGS )
add_c_flag_if_supported ( -fstack-protector-strong C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -fstack-protector-strong CXX_SECURITY_FLAGS )
endif ( )
# New in GCC 8.2
if ( NOT OPENBSD AND NOT ( WIN32 AND ( CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1 ) ) )
add_c_flag_if_supported ( -fcf-protection=full C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -fcf-protection=full CXX_SECURITY_FLAGS )
endif ( )
if ( NOT WIN32 AND NOT OPENBSD )
add_c_flag_if_supported ( -fstack-clash-protection C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -fstack-clash-protection CXX_SECURITY_FLAGS )
endif ( )
# Removed in GCC 9.1 (or before ?), but still accepted, so spams the output
if ( NOT ( CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1 ) )
add_c_flag_if_supported ( -mmitigate-rop C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -mmitigate-rop CXX_SECURITY_FLAGS )
endif ( )
# linker
2020-05-14 20:48:08 +02:00
if ( NOT ( WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU" ) )
# Windows binaries die on startup with PIE when compiled with GCC
2019-11-29 11:09:00 +01:00
add_linker_flag_if_supported ( -pie LD_SECURITY_FLAGS )
endif ( )
add_linker_flag_if_supported ( -Wl,-z,relro LD_SECURITY_FLAGS )
add_linker_flag_if_supported ( -Wl,-z,now LD_SECURITY_FLAGS )
add_linker_flag_if_supported ( -Wl,-z,noexecstack noexecstack_SUPPORTED )
if ( noexecstack_SUPPORTED )
set ( LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecstack" )
endif ( )
add_linker_flag_if_supported ( -Wl,-z,noexecheap noexecheap_SUPPORTED )
if ( noexecheap_SUPPORTED )
set ( LD_SECURITY_FLAGS "${LD_SECURITY_FLAGS} -Wl,-z,noexecheap" )
endif ( )
2020-04-08 04:31:16 +02:00
# some windows linker bits
if ( WIN32 )
add_linker_flag_if_supported ( -Wl,--dynamicbase LD_SECURITY_FLAGS )
add_linker_flag_if_supported ( -Wl,--nxcompat LD_SECURITY_FLAGS )
add_linker_flag_if_supported ( -Wl,--high-entropy-va LD_SECURITY_FLAGS )
endif ( )
2020-05-15 04:28:47 +02:00
add_linker_flag_if_supported ( -static-libgcc STATIC_FLAGS )
add_linker_flag_if_supported ( -static-libstdc++ STATIC_FLAGS )
2020-03-06 12:54:16 +01:00
if ( STATIC )
if ( MINGW )
add_linker_flag_if_supported ( -static STATIC_FLAGS )
endif ( )
endif ( )
2020-04-08 04:31:16 +02:00
# With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that
# is fixed in the code (Issue #847), force compiler to be conservative.
add_c_flag_if_supported ( -fno-strict-aliasing C_SECURITY_FLAGS )
add_cxx_flag_if_supported ( -fno-strict-aliasing CXX_SECURITY_FLAGS )
2019-11-29 11:09:00 +01:00
message ( STATUS "Using C security hardening flags: ${C_SECURITY_FLAGS}" )
message ( STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}" )
message ( STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}" )
2020-04-08 04:31:16 +02:00
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${C_SECURITY_FLAGS}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${CXX_SECURITY_FLAGS}" )
2020-03-06 12:54:16 +01:00
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}" )
2019-10-02 22:33:48 +02:00
2019-10-02 17:11:59 +02:00
if ( HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED )
if ( APPLE )
if ( DEPENDS )
list ( APPEND EXTRA_LIBRARIES "-framework Foundation -framework IOKit" )
else ( )
find_library ( COREFOUNDATION CoreFoundation )
find_library ( IOKIT IOKit )
list ( APPEND EXTRA_LIBRARIES ${ IOKIT } )
list ( APPEND EXTRA_LIBRARIES ${ COREFOUNDATION } )
endif ( )
endif ( )
if ( WIN32 )
2019-10-07 14:07:09 +02:00
list ( APPEND EXTRA_LIBRARIES setupapi Version )
2019-10-02 17:11:59 +02:00
endif ( )
endif ( )
2018-05-09 02:01:27 +02:00
add_subdirectory ( src )
# Required to make wallet_merged build before the gui
2020-05-13 16:26:14 +02:00
add_dependencies ( monero-wallet-gui wallet_merged )
2018-05-09 02:01:27 +02:00