Skip to content

Commit

Permalink
Initial commmit
Browse files Browse the repository at this point in the history
  • Loading branch information
MariSoejima committed Oct 11, 2019
1 parent 6d08bc3 commit acc9869
Show file tree
Hide file tree
Showing 248 changed files with 71,528 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Run manually to reformat a file:
# clang-format -i --style=file <file>
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 79
BinPackArguments: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
BinPackParameters: true
BinPackArguments: true
ReflowComments: false
#AlwaysBreakTemplateDeclarations: MultiLine
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlines: DontAlign
AlignConsecutiveDeclarations: false
AlignOperands: true
AlignTrailingComments: true
#AllowShortLambdasOnASingleLine: inline
#AllowAllArgumentsOnNextLine: true
#AllowAllConstructorInitializersOnNextLine: true
#AllowAllParametersOfDeclarationOnNextLine: true
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.ac text eol=lf
*.am text eol=lf
*.sh text eol=lf
*.pl text eol=lf
*.py text eol=lf
69 changes: 69 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## 関連Issue

<!--
このPRが、ZenHubのどのIssueに紐づいているかを記載する
- ZenHubのURL
-->

## 概要

<!--
- 追加機能の概要を記載
- 前提が共有されていない場合は、
なぜこの変更をして、
どう解決されるのかも併せて記載する
- 必要であれば、以下のような詳細についても記載する
- 以下の観点で、レビューアーにわかるように技術的な変更点の概要を記載
- 何をどう変更したか
- どういった手法を採用したか
(e.g. パス探索については、幅優先探索を採用した)
- 外部システムとのI/F変更
- など
-->

-

## 使い方

<!--
- PRの動作確認方法
- 動作確認が必要なタスクについては、必要なコマンドなどを記載
- 必要なければ、無記載で良い
-->

```bash
```

## 今回保留した項目とTODO

<!--
- 箇条書きで保留した項目があれば、記載
- 保留項目が直近の対応が必要な場合、対応チケットを作成して記載
記載例
- 〇〇の計算ロジックの本実装 #0000
-->

-

## 確認項目

**PRを出した人**
<!-- PRを出す前後で確認する項目 -->

- [ ] チェックスクリプトでチェックを実施した <!-- npm run check -->
- [ ] 正常にビルドできた
- [ ] 関連チケットに実績をつけた
- [ ] ZenHubでPRとIssueを関連付けた
- [ ] ZenHubのIssueを `Review/QA` Pipelineに移した

**レビューする人**
<!-- レビューをする前後で確認する項目 -->
- [ ] 関連チケットにレビュー実績をつけた

## 備考

<!--
- 実装に関する悩み(AにするかBにするか迷ったがAにしたや、こうしたかったけどできなかったなど)があれば記載
-->
158 changes: 158 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Autotools
/bin
autom4te.cache
*.in
/Makefile
/config.h
*.m4
config.h.in~
config.log
config.status
config.sub
configure
install-sh
missing
stamp-h1
compile
config.guess
/config.h
depcomp
libtool
ltmain.sh
*.Tpo
*.Plo
*.Po
.dirstamp
test-driver
build
.libs
node_modules
package-lock.json
html
html_graph
html_all
html_all_graph
html_all_quiet
latex

### https://raw.github.com/github/gitignore//Global/Eclipse.gitignore

.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# PyDev specific (Python IDE for Eclipse)
*.pydevproject

# CDT-specific (C/C++ Development Tooling)
.cproject

# CDT- autotools
.autotools

# Java annotation processor (APT)
.factorypath

# PDT-specific (PHP Development Tools)
.buildpath

# sbteclipse plugin
.target

# Tern plugin
.tern-project

# TeXlipse plugin
.texlipse

# STS (Spring Tool Suite)
.springBeans

# Code Recommenders
.recommenders/

# Annotation Processing
.apt_generated/

# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet

### https://raw.github.com/github/gitignore/c4ed859434e4eb33c85ad8048fc907d470f8ae4b/Global/VisualStudioCode.gitignore

.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json


/wally.js
/wrap_js/wally.js
output

m4
ar-lib
confdefs.h
test-driver

# User Definition
/.cproject
/.externalToolBuilders/org.eclipse.cdt.autotools.core.genmakebuilderV2.launch
/.settings/language.settings.xml
/test/test-suite.log
/test/test_wallet.log
/test/test_wallet.trs
/pc/*.pc

external/*
!external/CMakeLists.txt
!external/template_CMakeLists.txt.in
112 changes: 112 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
cmake_minimum_required(VERSION 3.13)

# configure.ac: AC_INIT([cfd-core], [1.0]
set(PACKAGE_VERSION 1.0.0)

####################
# options
####################
if(CMAKE_JS_INC)
option(ENABLE_SHARED "enable shared library (ON or OFF. default:ON)" ON)
else()
option(ENABLE_SHARED "enable shared library (ON or OFF. default:OFF)" OFF)
endif()
# use "cmake -DCMAKE_BUILD_TYPE=Debug" or "cmake-js -D"
# option(ENABLE_DEBUG "enable debugging (ON or OFF. default:OFF)" OFF)
option(ENABLE_TESTS "enable code tests (ON or OFF. default:ON)" ON)
option(ENABLE_ELEMENTS "enable elements code (ON or OFF. default:ON)" ON)
option(ENABLE_BITCOIN "enable bitcoin code (ON or OFF. default:ON)" ON)
option(ENABLE_SWIG_PYTHON "enable the SWIG python interface (ON or OFF. default:OFF)" OFF)
option(ENABLE_SWIG_JAVA "enable the SWIG java (JNI) interface (ON or OFF. default:OFF)" OFF)

if(CMAKE_JS_INC)
option(ENABLE_JS_WRAPPER "enable the Javascript interface wrappers (ON or OFF. default:ON)" ON)
else()
set(ENABLE_JS_WRAPPER OFF)
endif()

if(NOT WIN32)
#option(TARGET_RPATH "target rpath list (separator is ';') (default:)" "")
set(TARGET_RPATH "" CACHE STRING "target rpath list (separator is ';') (default:)")
option(ENABLE_COVERAGE "enable code coverage (ON or OFF. default:OFF)" OFF)
option(ENABLE_EXPORT_ALL "enable export all functions (for testing) (ON or OFF. default:OFF)" OFF)
else()
set(TARGET_RPATH "")
set(ENABLE_COVERAGE FALSE)
endif()

set(GENERATE_WALLY ON)


####################
# common setting
####################
set(WORK_WINDOWS_BINARY_DIR_NAME $<IF:$<CONFIG:Debug>,Debug,Release>)
if(NOT CFD_OBJ_BINARY_DIR)
set(CFD_OBJ_BINARY_DIR ${CMAKE_BINARY_DIR}/${WORK_WINDOWS_BINARY_DIR_NAME})
set(CFD_ROOT_BINARY_DIR ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CFD_OBJ_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CFD_OBJ_BINARY_DIR}) # for linux
endif()
# for libwally
set(WALLY_OBJ_BINARY_DIR ${CFD_OBJ_BINARY_DIR})
set(WALLY_ROOT_BINARY_DIR ${CFD_ROOT_BINARY_DIR})


####################
# function
####################
function(transform_makefile_srclist INPUT_FILE OUTPUT_FILE)
file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT)

string(REGEX REPLACE "\\\\\n" "@@@@LF@@@@" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
string(REPLACE "@@@@LF@@@@" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
endfunction()


####################
# test
####################
if(ENABLE_TESTS)
enable_testing()
endif() # ENABLE_TESTS

####################
# subdirectories
####################
if(NOT CFD_SINGLE_BUILD)
add_subdirectory(external)
endif()
add_subdirectory(src/univalue)
add_subdirectory(src)


####################
# test subdirectories
####################
if(ENABLE_TESTS)
project(cfdcore_all_test CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(CTest)
add_subdirectory(test)
endif() # ENABLE_TESTS


####################
# install & export
####################
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${prefix})
set(libdir ${exec_prefix}/lib)
set(includedir ${prefix}/include)
include(GNUInstallDirs)

configure_file(pc/cfd-core.pc.in cfd-core.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cfd-core.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
Loading

0 comments on commit acc9869

Please sign in to comment.