Reference core API code through submodule.

This commit is contained in:
Maarten Billemont 2021-02-01 09:39:55 -05:00
parent bba0db07fe
commit f79c1208b1
4 changed files with 28 additions and 24 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "api"]
path = api
url = git@gitlab.com:spectre.app/api.git

View file

@ -123,11 +123,11 @@ endfunction()
### TARGET: MPW
if( BUILD_MPW )
# target
add_executable( mpw "../core/src/base64.c" "../core/src/aes.c" "../core/src/mpw-algorithm.c"
"../core/src/mpw-algorithm_v0.c" "../core/src/mpw-algorithm_v1.c" "../core/src/mpw-algorithm_v2.c" "../core/src/mpw-algorithm_v3.c"
"../core/src/mpw-types.c" "../core/src/mpw-util.c" "../core/src/mpw-marshal-util.c" "../core/src/mpw-marshal.c"
add_executable( mpw "api/c/base64.c" "api/c/aes.c" "api/c/mpw-algorithm.c"
"api/c/mpw-algorithm_v0.c" "api/c/mpw-algorithm_v1.c" "api/c/mpw-algorithm_v2.c" "api/c/mpw-algorithm_v3.c"
"api/c/mpw-types.c" "api/c/mpw-util.c" "api/c/mpw-marshal-util.c" "api/c/mpw-marshal.c"
"src/mpw-cli-util.c" "src/mpw-cli.c" )
target_include_directories( mpw PUBLIC ../core/src src )
target_include_directories( mpw PUBLIC api/c src )
install( TARGETS mpw RUNTIME DESTINATION bin )
# dependencies
@ -140,10 +140,10 @@ endif()
### TARGET: MPW-BENCH
if( BUILD_MPW_BENCH )
# target
add_executable( mpw-bench "../core/src/base64.c" "../core/src/aes.c" "../core/src/mpw-algorithm.c"
"../core/src/mpw-algorithm_v0.c" "../core/src/mpw-algorithm_v1.c" "../core/src/mpw-algorithm_v2.c" "../core/src/mpw-algorithm_v3.c"
"../core/src/mpw-types.c" "../core/src/mpw-util.c" "src/mpw-bench.c" )
target_include_directories( mpw-bench PUBLIC ../core/src src )
add_executable( mpw-bench "api/c/base64.c" "api/c/aes.c" "api/c/mpw-algorithm.c"
"api/c/mpw-algorithm_v0.c" "api/c/mpw-algorithm_v1.c" "api/c/mpw-algorithm_v2.c" "api/c/mpw-algorithm_v3.c"
"api/c/mpw-types.c" "api/c/mpw-util.c" "src/mpw-bench.c" )
target_include_directories( mpw-bench PUBLIC api/c src )
install( TARGETS mpw-bench RUNTIME DESTINATION bin )
# dependencies
@ -154,10 +154,10 @@ endif()
### TARGET: MPW-TESTS
if( BUILD_MPW_TESTS )
# target
add_executable( mpw-tests "../core/src/base64.c" "../core/src/aes.c" "../core/src/mpw-algorithm.c"
"../core/src/mpw-algorithm_v0.c" "../core/src/mpw-algorithm_v1.c" "../core/src/mpw-algorithm_v2.c" "../core/src/mpw-algorithm_v3.c"
"../core/src/mpw-types.c" "../core/src/mpw-util.c" "src/mpw-tests-util.c" "src/mpw-tests.c" )
target_include_directories( mpw-tests PUBLIC ../core/src src )
add_executable( mpw-tests "api/c/base64.c" "api/c/aes.c" "api/c/mpw-algorithm.c"
"api/c/mpw-algorithm_v0.c" "api/c/mpw-algorithm_v1.c" "api/c/mpw-algorithm_v2.c" "api/c/mpw-algorithm_v3.c"
"api/c/mpw-types.c" "api/c/mpw-util.c" "src/mpw-tests-util.c" "src/mpw-tests.c" )
target_include_directories( mpw-tests PUBLIC api/c src )
install( TARGETS mpw-tests RUNTIME DESTINATION bin )
# dependencies

1
api Submodule

@ -0,0 +1 @@
Subproject commit 84573c3ba7006f9eede31be1974d292f9999e312

24
build
View file

@ -92,7 +92,7 @@ mpw() {
"${cflags[@]}"
# mpw paths
-I"../core/src" -I"src"
-I"api/c" -I"src"
)
ldflags=(
"${ldflags[@]}"
@ -100,9 +100,9 @@ mpw() {
# build
cc "${cflags[@]}" "$@" \
"../core/src/base64.c" "../core/src/aes.c" "../core/src/mpw-algorithm.c" \
"../core/src/mpw-algorithm_v0.c" "../core/src/mpw-algorithm_v1.c" "../core/src/mpw-algorithm_v2.c" "../core/src/mpw-algorithm_v3.c" \
"../core/src/mpw-types.c" "../core/src/mpw-util.c" "../core/src/mpw-marshal-util.c" "../core/src/mpw-marshal.c" "src/mpw-cli-util.c" \
"api/c/base64.c" "api/c/aes.c" "api/c/mpw-algorithm.c" \
"api/c/mpw-algorithm_v0.c" "api/c/mpw-algorithm_v1.c" "api/c/mpw-algorithm_v2.c" "api/c/mpw-algorithm_v3.c" \
"api/c/mpw-types.c" "api/c/mpw-util.c" "api/c/mpw-marshal-util.c" "api/c/mpw-marshal.c" "src/mpw-cli-util.c" \
"${ldflags[@]}" "src/mpw-cli.c" -o "mpw"
echo "done! You can now run ./mpw-cli-tests, ./install or use ./$_"
}
@ -118,7 +118,7 @@ mpw-bench() {
"${cflags[@]}"
# mpw paths
-I"../core/src" -I"src"
-I"api/c" -I"src"
)
ldflags=(
"${ldflags[@]}"
@ -126,9 +126,9 @@ mpw-bench() {
# build
cc "${cflags[@]}" "$@" \
"../core/src/base64.c" "../core/src/aes.c" "../core/src/mpw-algorithm.c" \
"../core/src/mpw-algorithm_v0.c" "../core/src/mpw-algorithm_v1.c" "../core/src/mpw-algorithm_v2.c" "../core/src/mpw-algorithm_v3.c" \
"../core/src/mpw-types.c" "../core/src/mpw-util.c" \
"api/c/base64.c" "api/c/aes.c" "api/c/mpw-algorithm.c" \
"api/c/mpw-algorithm_v0.c" "api/c/mpw-algorithm_v1.c" "api/c/mpw-algorithm_v2.c" "api/c/mpw-algorithm_v3.c" \
"api/c/mpw-types.c" "api/c/mpw-util.c" \
"${ldflags[@]}" "src/mpw-bench.c" -o "mpw-bench"
echo "done! You can now use ./$_"
}
@ -145,7 +145,7 @@ mpw-tests() {
"${cflags[@]}"
# mpw paths
-I"../core/src" -I"src"
-I"api/c" -I"src"
)
ldflags=(
"${ldflags[@]}"
@ -153,9 +153,9 @@ mpw-tests() {
# build
cc "${cflags[@]}" "$@" \
"../core/src/base64.c" "../core/src/aes.c" "../core/src/mpw-algorithm.c" \
"../core/src/mpw-algorithm_v0.c" "../core/src/mpw-algorithm_v1.c" "../core/src/mpw-algorithm_v2.c" "../core/src/mpw-algorithm_v3.c" \
"../core/src/mpw-types.c" "../core/src/mpw-util.c" "src/mpw-tests-util.c" \
"api/c/base64.c" "api/c/aes.c" "api/c/mpw-algorithm.c" \
"api/c/mpw-algorithm_v0.c" "api/c/mpw-algorithm_v1.c" "api/c/mpw-algorithm_v2.c" "api/c/mpw-algorithm_v3.c" \
"api/c/mpw-types.c" "api/c/mpw-util.c" "src/mpw-tests-util.c" \
"${ldflags[@]}" "src/mpw-tests.c" -o "mpw-tests"
echo "done! You can now use ./$_"
}