Skip to content

Commit

Permalink
Merge pull request #1910 from crypto-ape/support_building_on_open_bsd
Browse files Browse the repository at this point in the history
Support Building on OpenBSD
  • Loading branch information
pmconrad authored Aug 22, 2019
2 parents 4fdb650 + 26cebe7 commit 82d900f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,19 @@ else( WIN32 ) # Apple AND Linux
message( STATUS "Configuring BitShares on OS X" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -stdlib=libc++ -Wall" )
else( APPLE )
# Linux Specific Options Here
message( STATUS "Configuring BitShares on Linux" )
if ( "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD" )
# OpenBSD Specific Options
message( STATUS "Configuring BitShares on OpenBSD" )
else()
# Linux Specific Options Here
message( STATUS "Configuring BitShares on Linux" )
set( rt_library rt )
endif()
# Common Linux & OpenBSD Options
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wall" )
if(USE_PROFILER)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg" )
endif( USE_PROFILER )
set( rt_library rt )
set( pthread_library pthread)
if ( NOT DEFINED crypto_library )
# I'm not sure why this is here, I guess someone has openssl and can't detect it with find_package()?
Expand Down
2 changes: 2 additions & 0 deletions libraries/net/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,8 @@ namespace graphene { namespace net { namespace detail {
user_data["fc_git_revision_unix_timestamp"] = fc::git_revision_unix_timestamp;
#if defined( __APPLE__ )
user_data["platform"] = "osx";
#elif defined( __OpenBSD__ )
user_data["platform"] = "obsd";
#elif defined( __linux__ )
user_data["platform"] = "linux";
#elif defined( _MSC_VER )
Expand Down
3 changes: 2 additions & 1 deletion tests/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@
#include <winsock2.h>
#include <WS2tcpip.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <sys/types.h>
#endif
#include <thread>

Expand Down
17 changes: 8 additions & 9 deletions tests/performance/performance_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <boost/test/unit_test.hpp>

#include <boost/test/included/unit_test.hpp>

boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) {
std::srand(time(NULL));
std::cout << "Random number generator seeded to " << time(NULL) << std::endl;
return nullptr;
}

#include <graphene/chain/database.hpp>

Expand Down Expand Up @@ -208,11 +215,3 @@ BOOST_AUTO_TEST_CASE( one_hundred_k_benchmark )
} FC_LOG_AND_RETHROW() }

BOOST_AUTO_TEST_SUITE_END()

#include <boost/test/included/unit_test.hpp>

boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) {
std::srand(time(NULL));
std::cout << "Random number generator seeded to " << time(NULL) << std::endl;
return nullptr;
}

0 comments on commit 82d900f

Please sign in to comment.