forked from amjuarez/bytecoin
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Antonio Juarez
committed
Mar 3, 2014
1 parent
095fbee
commit 296ae46
Showing
388 changed files
with
95,932 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git* export-ignore | ||
/CMakeLists.txt export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/build | ||
/tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
cmake_minimum_required(VERSION 2.8.6) | ||
|
||
set(VERSION "0.1") | ||
# $Format:Packaged from commit %H%nset(COMMIT %h)%nset(REFS "%d")$ | ||
|
||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release") | ||
enable_testing() | ||
|
||
include_directories(src contrib/epee/include "${CMAKE_BINARY_DIR}/version") | ||
|
||
set(STATIC ${MSVC} CACHE BOOL "Link libraries statically") | ||
|
||
if(MSVC) | ||
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__") | ||
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10485760") | ||
if(STATIC) | ||
foreach(VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE) | ||
string(REPLACE "/MD" "/MT" ${VAR} "${${VAR}}") | ||
endforeach() | ||
endif() | ||
include_directories(SYSTEM src/platform/msc) | ||
else() | ||
set(ARCH native CACHE STRING "CPU to build for: -march value or default") | ||
if("${ARCH}" STREQUAL "default") | ||
set(ARCH_FLAG "") | ||
else() | ||
set(ARCH_FLAG "-march=${ARCH}") | ||
endif() | ||
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Werror -Wno-error=extra -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized") | ||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang") | ||
set(WARNINGS "${WARNINGS} -Wno-error=mismatched-tags -Wno-error=null-conversion -Wno-overloaded-shift-op-parentheses -Wno-error=shift-count-overflow -Wno-error=tautological-constant-out-of-range-compare -Wno-error=unused-private-field -Wno-error=unneeded-internal-declaration") | ||
else() | ||
set(WARNINGS "${WARNINGS} -Wlogical-op -Wno-error=maybe-uninitialized") | ||
endif() | ||
if(MINGW) | ||
set(WARNINGS "${WARNINGS} -Wno-error=unused-value") | ||
set(MINGW_FLAG "-DWIN32_LEAN_AND_MEAN") | ||
include_directories(SYSTEM src/platform/mingw) | ||
else() | ||
set(MINGW_FLAG "") | ||
endif() | ||
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes") | ||
set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers") | ||
try_compile(STATIC_ASSERT_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/utils/test-static-assert.c" COMPILE_DEFINITIONS "-std=c11") | ||
if(STATIC_ASSERT_RES) | ||
set(STATIC_ASSERT_FLAG "") | ||
else() | ||
set(STATIC_ASSERT_FLAG "-Dstatic_assert=_Static_assert") | ||
endif() | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG}") | ||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)) | ||
set(DEBUG_FLAGS "-g3 -Og") | ||
else() | ||
set(DEBUG_FLAGS "-g3 -O0") | ||
endif() | ||
set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable -flto") | ||
#if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW) | ||
# set(RELEASE_FLAGS "${RELEASE_FLAGS} -fno-fat-lto-objects") | ||
#endif() | ||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEBUG_FLAGS}") | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}") | ||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}") | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}") | ||
if(STATIC) | ||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") | ||
function(add_executable name) | ||
_add_executable("${name}" ${ARGN}) | ||
set_target_properties("${name}" PROPERTIES LINK_SEARCH_START_STATIC ON LINK_SEARCH_END_STATIC ON) | ||
endfunction() | ||
endif() | ||
endif() | ||
|
||
if(STATIC) | ||
set(Boost_USE_STATIC_LIBS ON) | ||
set(Boost_USE_STATIC_RUNTIME ON) | ||
endif() | ||
find_package(Boost 1.53 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization atomic program_options) | ||
if((${Boost_MAJOR_VERSION} EQUAL 1) AND (${Boost_MINOR_VERSION} EQUAL 54)) | ||
message(SEND_ERROR "Boost version 1.54 is unsupported, more details are available here http://goo.gl/RrCFmA") | ||
endif() | ||
include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) | ||
if(MINGW) | ||
set(Boost_LIBRARIES "${Boost_LIBRARIES};ws2_32;mswsock") | ||
endif() | ||
|
||
set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version") | ||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/version") | ||
if (NOT COMMIT_ID_IN_VERSION) | ||
set(VERSION "${VERSION}-unknown") | ||
configure_file("src/version.h.in" "version/version.h") | ||
add_custom_target(version ALL) | ||
elseif(DEFINED COMMIT) | ||
string(REPLACE "." "\\." VERSION_RE "${VERSION}") | ||
if(NOT REFS MATCHES "(\\(|, )tag: v${VERSION_RE}(\\)|, )") | ||
set(VERSION "${VERSION}-g${COMMIT}") | ||
endif() | ||
configure_file("src/version.h.in" "version/version.h") | ||
add_custom_target(version ALL) | ||
else() | ||
find_package(Git QUIET) | ||
if(Git_FOUND) | ||
add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") | ||
else() | ||
set(VERSION "${VERSION}-unknown") | ||
configure_file("src/version.h.in" "version/version.h") | ||
add_custom_target(version ALL) | ||
endif() | ||
endif() | ||
|
||
add_subdirectory(src) | ||
add_subdirectory(tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
all: all-release | ||
|
||
cmake-debug: | ||
mkdir -p build/debug | ||
cd build/debug && cmake -D CMAKE_BUILD_TYPE=Debug ../.. | ||
|
||
build-debug: cmake-debug | ||
cd build/debug && $(MAKE) | ||
|
||
test-debug: build-debug | ||
cd build/debug && $(MAKE) test | ||
|
||
all-debug: build-debug | ||
|
||
cmake-release: | ||
mkdir -p build/release | ||
cd build/release && cmake -D CMAKE_BUILD_TYPE=Release ../.. | ||
|
||
build-release: cmake-release | ||
cd build/release && $(MAKE) | ||
|
||
test-release: build-release | ||
cd build/release && $(MAKE) test | ||
|
||
all-release: build-release | ||
|
||
clean: | ||
rm -rf build | ||
|
||
tags: | ||
ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest | ||
|
||
.PHONY: all cmake-debug build-debug test-debug all-debug cmake-release build-release test-release all-release clean tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-= Building Cybernote =- | ||
|
||
On *nix: | ||
|
||
Dependencies: GCC 4.7 or later, CMake 2.8.6 or later, and Boost 1.53 or later (except 1.54, more details here: http://goo.gl/RrCFmA). | ||
You may download them from: | ||
http://gcc.gnu.org/ | ||
http://www.cmake.org/ | ||
http://www.boost.org/ | ||
Alternatively, it may be possible to install them using a package manager. | ||
|
||
To build, change to a directory where this file is located, and run `make'. The resulting executables can be found in build/release/src. | ||
|
||
Advanced options: | ||
Parallel build: run `make -j<number of threads>' instead of `make'. | ||
Debug build: run `make build-debug'. | ||
Test suite: run `make test-release' to run tests in addition to building. Running `make test-debug' will do the same to the debug version. | ||
Building with Clang: it may be possible to use Clang instead of GCC, but this may not work everywhere. To build, run `export CC=clang CXX=clang++' before running `make'. | ||
|
||
On Windows: | ||
Dependencies: MSVC 2012 or later, CMake 2.8.6 or later, and Boost 1.53 or later. You may download them from: | ||
http://www.microsoft.com/ | ||
http://www.cmake.org/ | ||
http://www.boost.org/ | ||
|
||
To build, change to a directory where this file is located, and run this commands: | ||
mkdir build | ||
cd build | ||
cmake -G "Visual Studio 11 Win64" .. | ||
|
||
And then do Build. | ||
Good luck! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of the Andrey N. Sabelnikov nor the | ||
names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
|
||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL Andrey N. Sabelnikov BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
epee - is a small library of helpers, wrappers, tools and and so on, used to make my life easier. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
set(Boost_USE_MULTITHREADED ON) | ||
#set(Boost_DEBUG 1) | ||
find_package(Boost COMPONENTS system filesystem thread date_time chrono regex ) | ||
|
||
include_directories( ${Boost_INCLUDE_DIRS} ) | ||
|
||
|
||
IF (MSVC) | ||
add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /nologo /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /bigobj" ) | ||
ELSE() | ||
# set stuff for other systems | ||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-reorder -D_GNU_SOURCE") | ||
ENDIF() | ||
|
||
|
||
include_directories(.) | ||
include_directories(../include) | ||
include_directories(iface) | ||
|
||
|
||
# Add folders to filters | ||
file(GLOB_RECURSE LEVIN_GENERAL_SECTION RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/demo_levin_server/*.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/demo_levin_server/*.inl | ||
${CMAKE_CURRENT_SOURCE_DIR}/demo_levin_server/*.cpp) | ||
|
||
file(GLOB_RECURSE HTTP_GENERAL_SECTION RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR}/demo_http_server/*.h | ||
${CMAKE_CURRENT_SOURCE_DIR}/demo_http_server/*.inl | ||
${CMAKE_CURRENT_SOURCE_DIR}/demo_http_server/*.cpp) | ||
|
||
|
||
|
||
source_group(general FILES ${LEVIN_GENERAL_SECTION} FILES ${HTTP_GENERAL_SECTION}) | ||
#source_group(general FILES ${HTTP_GENERAL_SECTION}) | ||
|
||
add_executable(demo_http_server ${HTTP_GENERAL_SECTION} ) | ||
add_executable(demo_levin_server ${LEVIN_GENERAL_SECTION} ) | ||
|
||
target_link_libraries( demo_http_server ${Boost_LIBRARIES} ) | ||
target_link_libraries( demo_levin_server ${Boost_LIBRARIES} ) | ||
|
||
IF (NOT WIN32) | ||
target_link_libraries (demo_http_server rt) | ||
target_link_libraries (demo_levin_server rt) | ||
ENDIF() | ||
|
||
|
Empty file.
Oops, something went wrong.