From 802812b57e4403a18622ce0200ed0f6eaf8e085d Mon Sep 17 00:00:00 2001 From: HackFisher Date: Thu, 13 Feb 2014 11:40:47 +0800 Subject: [PATCH 1/4] Fix multi find_package change ${Boost_LIBRARIE} using boost>=1.54 with cmake on windows. When FIND_PACKAGE(BOOST ...) is run, it overwrites the previous ${Boost_LIBRARIES} with its own required libraries http://stackoverflow.com/questions/19720639/handling-multiple-find-package-calls-in-cmake --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62569ed..7eb2395 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,7 +44,9 @@ IF( WIN32 ) FIND_PACKAGE(Boost 1.53 REQUIRED COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context) # For Boost 1.53 on windows, coroutine was not in BOOST_LIBRARYDIR and do not need it to build, but if boost versin >= 1.54, find coroutine otherwise will cause link errors IF(NOT "${Boost_VERSION}" MATCHES "1.53(.*)") + SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES}) FIND_PACKAGE(Boost 1.54 REQUIRED COMPONENTS coroutine) + SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES}) ENDIF() ELSE(WIN32) From 4e68f4b1b7a879ca14b3e7ceab8f10631cc329c3 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 13 Feb 2014 00:02:15 -0500 Subject: [PATCH 2/4] fix build --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49aef3b..5eb4f79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ option( UNITY_BUILD OFF ) include_directories( ${Boost_INCLUDE_DIR} ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/salsa20 ) - +include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/easylzma/src ) FIND_PACKAGE( OpenSSL ) From 4571ce36d5b6b6fa8b8757f1368283472042c397 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 13 Feb 2014 01:47:08 -0500 Subject: [PATCH 3/4] fix bug in json file loading, see issue #8 --- src/io/json.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/io/json.cpp b/src/io/json.cpp index d4d488a..37f349b 100644 --- a/src/io/json.cpp +++ b/src/io/json.cpp @@ -6,6 +6,8 @@ #include #include //#include +#include +#include namespace fc { @@ -585,8 +587,10 @@ namespace fc } variant json::from_file( const fc::path& p ) { - auto tmp = std::make_shared( p, ifstream::binary ); - buffered_istream bi( tmp ); + //auto tmp = std::make_shared( p, ifstream::binary ); + //auto tmp = std::make_shared( p.generic_string().c_str(), std::ios::binary ); + //buffered_istream bi( tmp ); + std::ifstream bi( p.generic_string().c_str(), std::ios::binary ); return variant_from_stream( bi ); } variant json::from_stream( buffered_istream& in ) From 8c49a8b88723cff07f62499cf0f544d490578bb3 Mon Sep 17 00:00:00 2001 From: vogel76 Date: Thu, 13 Feb 2014 12:55:26 +0100 Subject: [PATCH 4/4] [BW]: [NIP] Further CMakeLists.txt cleanup to use target_* features. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84d9b4b..efb9535 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,8 +171,9 @@ IF(WIN32) target_compile_options(fc PUBLIC /EHa) ELSE() SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall" ) + IF(APPLE) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wall") + target_compile_options(fc PUBLIC -std=c++11 -stdlib=libc++ -Wall) ELSE() target_compile_options(fc PUBLIC -std=c++11 -Wall -fnon-call-exceptions -Wno-unused-local-typedefs -fmax-errors=3) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedefs -fmax-errors=3 ")