diff --git a/CMakeLists.txt b/CMakeLists.txt index 62569ed..f4567b0 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) @@ -55,7 +57,11 @@ ELSE(WIN32) SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so") - IF(NOT APPLE ) + 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 ) + IF(NOT APPLE ) # then unix # Unix build: SET(SALSA_SRC vendor/salsa20/salsa20.s) SET(rt_library rt ) @@ -167,6 +173,7 @@ IF(WIN32) target_compile_options(fc PUBLIC /EHa) ELSE() SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall" ) + IF(APPLE) target_compile_options(fc PUBLIC -std=c++11 -stdlib=libc++ -Wall) ELSE() 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 )