Merge remote-tracking branch 'origin/cmake' into docs

This commit is contained in:
reaction.la 2022-06-21 14:54:01 +10:00
commit 3129c736f2
No known key found for this signature in database
GPG Key ID: 99914792148C8388
5 changed files with 93 additions and 46 deletions

View File

@ -1,7 +1,6 @@
[core] [core]
autocrlf = input autocrlf = input
whitespace = -tab-in-indent,tabwidth=4,indent-with-non-tab,trailing-space,space-before-tab whitespace = -tab-in-indent,tabwidth=4,indent-with-non-tab,trailing-space,space-before-tab
whitespace = fix
safecrlf=warn safecrlf=warn
[apply] [apply]
whitespace = fix whitespace = fix
@ -19,6 +18,7 @@
[pull] [pull]
verify-signatures = true verify-signatures = true
[submodule] [submodule]
active = *
recurse = true recurse = true
[diff] [diff]
submodule = log submodule = log

27
CMakeLists.txt Normal file
View File

@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.22)
project(wallet)
# add_subdirectory(libsodium)
# add_subdirectory(mpir)
add_subdirectory(wxWidgets)
# include( ${libsodium_USE_FILE} )
# include( ${mpir_USE_FILE} )
# include( ${wxWidgets_USE_FILE} )
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Whenever this glob's value changes, cmake will rerun and update the build with the
# new/removed files.
file(GLOB walletcpp CONFIGURE_DEPENDS "*.cpp" )
file(GLOB walletc CONFIGURE_DEPENDS "*.c" )
file(GLOB walletmanifest CONFIGURE_DEPENDS "*.manifest" )
file(GLOB walletmanifest CONFIGURE_DEPENDS "*.rc" )
add_executable(${PROJECT_NAME}
${walletcpp}
${walletc}
${walletmanifest}
${walletrc}
)
target_link_libraries(${PROJECT_NAME}
${wxWidgets_LIBRARIES}
${libsodium_LIBRARIES}
${mpir_LIBRARIES}
)

View File

@ -10,47 +10,76 @@ pre-requisite, Pandoc to build the html documentation from the markdown files.
Windows pre-requisites: Visual Studio and git-bash Windows pre-requisites: Visual Studio and git-bash
To obtain the source code from which the project can be built, including To obtain the source code from which the project can be built,
this README, from the bash command line (git-bash in windows). including this README.html, from the bash command line (git-bash in windows).
```bash2 ```bash
git clone --recurse-submodules missing url git clone --recurse-submodules missing url
``` ```
To build the docs, you need pandoc on the path.
```bash2
cd wallet/docs
./mkdocs.sh
```
To configure and build the required third party libraries in windows, then To configure and build the required third party libraries in windows, then
build the program and run unit test for the first time, launch the Visual build the program and run unit test for the first time, you need to have
Studio X64 native tools command prompt in the cloned directory, then: Visual studio build tools at their default location)
```bat ```bash2
winConfigure.bat cd wallet
./winConfigure.bat
``` ```
Should the libraries change in a subsequent `pull ` you will need Or, if you are in the command shell or power shell,
```bat ```bat
git pull .\winConfigure.bat
rem you get a status message indicating libraries have been updated.
git pull -force --recurse-submodules
winConfigure.bat
``` ```
in order to rebuild the libraries. After a pull from remote in which the submodules have changed, the pull
fails to automatically update the submodules by default, and when you
switch or checkout branches, the switch fails to automatically switch
and checkout the brances.
The `--force` is necessary, because `winConfigure.bat` changes After a pull that gives you a status of modified submodules.
many of the library files, and therefore git will abort the pull.
```bash
git submodule update --init --recursive --remote
```
After a checkout or branch switch that gives you a status of modified submodules.
```bash
git submodule update --recursive
```
The documentation is in pandoc flavored markdown, which is
conveniently edited in vscode with the `markdown lint` and `Pandoc`
extensions included and, if you have launched `code` in the docs directory,
with `file/preferences/Extensions/Markdown/Styles` set to
`pandoc_templates\\style.css`, that being the style used by the `mkdocs.sh` documentation build script.
On Windows, if Git Bash and Pandoc has been installed, you should be
able to run this shell file in bash by double clicking on it.
if you add the recommended repository configuration defaults to your local repository configuration
```bash
git config --local include.path ../.gitconfig
```
this will substantially mitigate the problem of submodules failing to
update in pushes, pulls, checkouts, and switches.
[cryptographic software is under attack]:./docs/contributor_code_of_conduct.html#code-will-be-cryptographically-signed [cryptographic software is under attack]:./docs/contributor_code_of_conduct.html#code-will-be-cryptographically-signed
"Contributor Code of Conduct" "Contributor Code of Conduct"
{target="_blank"} {target="_blank"}
The winConfigure script builds everything, including the documents, but It will, however, also implement signed commits, insist that you have `gpg` on your path, and that you have cohfigured a signing key in your local config, and will refuse to pull updates that are signed by a gpg key that you have not locally trusted.
takes a while. Normally when you make changes to the source code you because [cryptographic software is under attack] from NSA
should rebuild just the program, using `wallet.sln` on windows.
To rebuild the documents after editing them, `docs/mkdocs`
winConfigure.bat also configures the repository you just created to use
`.gitconfig` in the repository, causing git to to implement GPG signed
commits -- because [cryptographic software is under attack] from NSA
entryists and shills, who seek to introduce backdoors. entryists and shills, who seek to introduce backdoors.
This may be inconvenient if you do not have `gpg` installed and set up. This may be inconvenient if you do not have `gpg` installed and set up.
@ -59,7 +88,7 @@ It also means that subsequent pulls and merges will require you to have `gpg `tr
`.gitconfig` adds several git aliases: `.gitconfig` adds several git aliases:
1. `git lg` to display the gpg trust information for the last four commits. 1. `git lg` to display the gpg trust information for the last few commits.
For this to be useful you need to import the repository public key For this to be useful you need to import the repository public key
`public_key.gpg` into gpg, and locally sign that key. `public_key.gpg` into gpg, and locally sign that key.
1. `git graph` to graph the commit tree with signing status 1. `git graph` to graph the commit tree with signing status
@ -105,11 +134,5 @@ addresses as owned by the same entity, and we don't want email
addresses used to link people to the project, because those addresses used to link people to the project, because those
identities would then come under state and quasi state pressure. identities would then come under state and quasi state pressure.
To build the documentation in its intended html form from the markdown [Pre alpha release](./RELEASE_NOTES.html), which means it does not yet work even well
files, execute the bash script file `docs/mkdocs.sh`, in an environment where enough for it to be apparent what it would do if it did work.
`pandoc` is available. On Windows, if Git Bash and Pandoc
has been installed, you should be able to run this shell
file in bash by double clicking on it.
[Pre alpha release](./RELEASE_NOTES.html), which means it does not yet work even well enough for
it to be apparent what it would do if it did work.

View File

@ -1,13 +1,9 @@
winConfigure.sh
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( call C:\"Program Files (x86)"\"Microsoft Visual Studio"\2022\BuildTools\VC\Auxiliary\Build\vcvarsamd64_x86.bat
echo error in git-bash shell file winConfigure.sh call C:\"Program Files"\"Microsoft Visual Studio"\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
PAUSE
GOTO:EOF
)
echo on echo on
cd libsodium cd libsodium
msbuild libsodium.sln -p:Configuration=Release;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0 -m msbuild libsodium.vcxproj -p:Configuration=Release;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0 -m
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
cd .. cd ..
@ -15,7 +11,7 @@ IF %ERRORLEVEL% NEQ 0 (
GOTO:EOF GOTO:EOF
) )
echo on echo on
msbuild libsodium.sln -p:Configuration=Debug;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0 -m msbuild libsodium.vcxproj -p:Configuration=Debug;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0 -m
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
cd .. cd ..
@ -82,14 +78,14 @@ IF %ERRORLEVEL% NEQ 0 (
echo on echo on
cd ..\..\.. cd ..\..\..
cd wxWidgets\build\msw cd wxWidgets\build\msw
msbuild wx_vc16.sln -m -p:Configuration=Release;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0 msbuild wx_vc17.sln -m -p:Configuration=Release;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
PAUSE PAUSE
GOTO:EOF GOTO:EOF
) )
echo on echo on
msbuild wx_vc16.sln -m -p:Configuration=Debug;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0 msbuild wx_vc17.sln -m -p:Configuration=Debug;Platform=x64;PlatformToolset=v143;WindowsTargetPlatformVersion=10.0
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
PAUSE PAUSE
@ -98,14 +94,14 @@ IF %ERRORLEVEL% NEQ 0 (
echo on echo on
cd ..\..\.. cd ..\..\..
devenv wallet.sln /build "Debug|x64" msbuild wallet.vcxproj -p:Configuration=Debug;Platform=x64 -m
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
PAUSE PAUSE
GOTO:EOF GOTO:EOF
) )
echo on echo on
devenv wallet.sln /build "Release|x64" msbuild wallet.vcxproj -p:Configuration=Release;Platform=x64 -m
echo off echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
PAUSE PAUSE
@ -124,4 +120,5 @@ echo off
IF %ERRORLEVEL% NEQ 0 ( IF %ERRORLEVEL% NEQ 0 (
echo failed unit test on release build echo failed unit test on release build
) ELSE ( ) ELSE (
echo passed unit test on release build) echo passed unit test on release build
)