Skip to content

Commit

Permalink
Fix build errors: remove unused boost libraries, add libcxx option,
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-modelist-dev committed Oct 18, 2018
1 parent 3ffc85e commit 2550abb
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
/nmake-build/*
/3rd-party-components/lib/*
/3rd-party-components
/cmake-build-debug/*
/cmake-debug-build/*
/cmake-build-release/*
/cmake-build-debug*
/cmake-debug-build*
/cmake-build-release*
/key_data/*
/keychain_cmd_app/.idea/*
/keychain_lib/CMakeFiles/*
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
project( KeychainApp )
cmake_minimum_required( VERSION 3.0.2 )

if (NOT MSVC)
if ( LIBCXX_BUILD )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif()
endif()

add_subdirectory(./keychain_lib)
add_subdirectory(./libraries/secp256k1_ext)
add_subdirectory(./libraries/ethereum)
Expand Down
15 changes: 8 additions & 7 deletions keychain_cmd_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ project( KeychainCmdApp )
cmake_minimum_required( VERSION 3.0.2 )

set(CMAKE_CXX_FLAGS "-std=c++14")
set( CMAKE_EXE_LINKER_FLAGS )

if (NOT MSVC)
if ( LIBCXX_BUILD )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif()
endif()

SET(BOOST_COMPONENTS)
LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams)
LIST(APPEND BOOST_COMPONENTS date_time system filesystem program_options signals serialization chrono unit_test_framework locale iostreams)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )

SET(BOOST_ROOT $ENV{BOOST_ROOT})
set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF)

FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS coroutine)
LIST(APPEND BOOST_COMPONENTS coroutine)
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})

SET(Boost_LIBRARIES ${Boost_LIBRARIES})

find_library(LIB_OPENSSL NAME crypto HINTS "${OPENSSL_ROOT_DIR}/lib")
if( NOT MSVC )
Expand Down
15 changes: 9 additions & 6 deletions keychain_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ project( KeychainLib )

cmake_minimum_required( VERSION 3.0.2 )

set(CMAKE_CXX_FLAGS "-std=c++14 ")
set(CMAKE_CXX_FLAGS "-std=c++14")

if (NOT MSVC)
if ( LIBCXX_BUILD )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif()
endif()

SET(BOOST_COMPONENTS)
LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams)
LIST(APPEND BOOST_COMPONENTS date_time system filesystem program_options serialization chrono unit_test_framework locale iostreams)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )

SET(BOOST_ROOT $ENV{BOOST_ROOT})
set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF)

FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS coroutine)
LIST(APPEND BOOST_COMPONENTS coroutine)
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
SET(Boost_LIBRARIES ${Boost_LIBRARIES})

if( MSVC )
include_directories(
Expand Down
13 changes: 8 additions & 5 deletions keychain_linux/passentry_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ set(CMAKE_CXX_STANDARD 14)
#set(CMAKE_CXX_FLAGS "-std=c++14 --verbose -fno-limit-debug-info")
set(CMAKE_CXX_FLAGS "-std=c++14 ")

if (NOT MSVC)
if ( LIBCXX_BUILD )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif()
endif()

set (CMAKE_PREFIX_PATH "${QT_ROOT}/5.11.1/gcc_64/lib/cmake/Qt5Widgets/")

project(passentrygui)
Expand All @@ -18,17 +24,14 @@ set(CMAKE_AUTOMOC ON)
find_library(LIB_PTHREAD NAME pthread HINTS "/usr/lib/x86_64-linux-gnu")

SET(BOOST_COMPONENTS)
LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams)
LIST(APPEND BOOST_COMPONENTS date_time system filesystem program_options signals serialization chrono unit_test_framework locale iostreams)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )

set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF)

FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
FIND_PACKAGE(Boost 1.65 REQUIRED COMPONENTS coroutine)
LIST(APPEND BOOST_COMPONENTS coroutine)
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
SET(Boost_LIBRARIES ${Boost_LIBRARIES})

include_directories(
"../../libraries/fc_light/include"
Expand Down
6 changes: 6 additions & 0 deletions libraries/ethereum/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
file(GLOB ETHER_HEADERS "include/ethereum/core/*.h" "include/ethereum/crypto/*.h")
file(GLOB ETHER_SOURCES "src/core/*.cpp" "src/crypto/*.cpp")

if (NOT MSVC)
if ( LIBCXX_BUILD )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif()
endif()

IF(NOT "$ENV{OPENSSL_ROOT_DIR}" STREQUAL "")
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR} )
set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
Expand Down
8 changes: 7 additions & 1 deletion libraries/fc_light/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ cmake_minimum_required( VERSION 3.0.2 )

set(CMAKE_CXX_FLAGS "-std=c++14 ")

if (NOT MSVC)
if ( LIBCXX_BUILD )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif()
endif()

SET(BOOST_COMPONENTS)
LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams)
LIST(APPEND BOOST_COMPONENTS date_time system filesystem program_options signals serialization chrono unit_test_framework locale iostreams)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )

SET(BOOST_ROOT $ENV{BOOST_ROOT})
Expand Down
6 changes: 6 additions & 0 deletions libraries/secp256k1_ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ project( Secp256k1_bitcon )

add_definitions(-DENABLE_MODULE_RECOVERY -DENABLE_MODULE_ECDH)

if (NOT MSVC)
if ( LIBCXX_BUILD )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
endif()
endif()

set( SECP256K1_DIR "../secp256k1" )

file( GLOB SECP256K1_SOURCES
Expand Down

0 comments on commit 2550abb

Please sign in to comment.