Skip to content

Commit

Permalink
cmake: cleanup linking
Browse files Browse the repository at this point in the history
  • Loading branch information
tobtoht committed Oct 1, 2024
1 parent 8ab420b commit 8e31b2b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 328 deletions.
34 changes: 2 additions & 32 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/monero/CMakeLists.txt")
message(FATAL_ERROR "'monero/CMakeLists.txt' does not exist, did you forget to:\ngit submodule update --init --recursive --progress")
endif()
add_subdirectory(monero EXCLUDE_FROM_ALL)
set_property(TARGET wallet_merged PROPERTY FOLDER "monero")
get_directory_property(ARCH_WIDTH DIRECTORY "monero" DEFINITION ARCH_WIDTH)
get_directory_property(UNBOUND_LIBRARY DIRECTORY "monero" DEFINITION UNBOUND_LIBRARY)
get_directory_property(DEVICE_TREZOR_READY DIRECTORY "monero" DEFINITION DEVICE_TREZOR_READY)
get_directory_property(TREZOR_DEP_LIBS DIRECTORY "monero" DEFINITION TREZOR_DEP_LIBS)
get_directory_property(OPENBSD DIRECTORY "monero" DEFINITION OPENBSD)
Expand All @@ -91,10 +89,6 @@ endif()
# pthread
find_package(Threads REQUIRED)

# Sodium
find_library(SODIUM_LIBRARY sodium)
message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}")

# QrEncode
find_package(QREncode REQUIRED)

Expand Down Expand Up @@ -136,29 +130,12 @@ if(MINGW)
set(MINGW_FLAG "${MINGW_FLAG} -DWIN32_LEAN_AND_MEAN")
set(Boost_THREADAPI win32)
endif()

set(BOOST_COMPONENTS
chrono
date_time
filesystem
program_options
regex
serialization
system
thread
)
if (WIN32)
list(APPEND BOOST_COMPONENTS locale)
endif()
set(Boost_USE_MULTITHREADED ON)

if(STACK_TRACE AND UNIX AND NOT APPLE)
list(APPEND BOOST_COMPONENTS
stacktrace_basic)
find_package(Boost 1.58 REQUIRED COMPONENTS stacktrace_basic)
endif()

set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.58 REQUIRED COMPONENTS ${BOOST_COMPONENTS})

if(UNIX AND NOT APPLE)
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
# https://github.com/monero-project/monero-gui/issues/3142#issuecomment-705940446
Expand Down Expand Up @@ -252,13 +229,6 @@ if (NOT WIN32 AND NOT OPENBSD AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"
add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS)
endif()

# -mmitigate-rop
# 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
if (APPLE)
add_linker_flag_if_supported(-Wl,-bind_at_load LD_SECURITY_FLAGS)
Expand Down
291 changes: 0 additions & 291 deletions cmake/FindSodium.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion monero
5 changes: 1 addition & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,8 @@ if (DEPENDS)
endif()

target_link_libraries(feather PRIVATE
wallet_merged
${LMDB_LIBRARY}
wallet_api
epee
${UNBOUND_LIBRARY}
${SODIUM_LIBRARY}
easylogging
ringct
${Boost_LIBRARIES}
Expand Down

0 comments on commit 8e31b2b

Please sign in to comment.