2022-03-22 11:03:15 -04:00
|
|
|
cmake_minimum_required(VERSION 3.11)
|
2022-06-29 09:26:29 -04:00
|
|
|
project(constellation LANGUAGES C VERSION 0.1.0)
|
2022-03-22 11:03:15 -04:00
|
|
|
|
2022-07-11 09:19:56 -04:00
|
|
|
set(CLI_VERSION "v0.1.0" CACHE STRING "Version of CLI binary.")
|
|
|
|
|
2022-03-22 11:03:15 -04:00
|
|
|
enable_testing()
|
|
|
|
|
2022-04-05 09:12:20 -04:00
|
|
|
#
|
|
|
|
# core-os disk-mapper
|
|
|
|
#
|
2022-04-21 09:01:47 -04:00
|
|
|
add_custom_target(disk-mapper ALL
|
2022-05-23 04:35:14 -04:00
|
|
|
DOCKER_BUILDKIT=1 docker build -o ${CMAKE_BINARY_DIR} -f Dockerfile.build --target disk-mapper .
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
BYPRODUCTS disk-mapper
|
2022-04-05 09:12:20 -04:00
|
|
|
)
|
|
|
|
|
2022-03-22 11:03:15 -04:00
|
|
|
#
|
2022-06-29 09:26:29 -04:00
|
|
|
# bootstrapper
|
2022-03-22 11:03:15 -04:00
|
|
|
#
|
|
|
|
|
2022-06-29 09:26:29 -04:00
|
|
|
add_custom_target(bootstrapper ALL
|
|
|
|
DOCKER_BUILDKIT=1 docker build -o ${CMAKE_BINARY_DIR} --build-arg PROJECT_VERSION=${PROJECT_VERSION} -f Dockerfile.build --target bootstrapper .
|
2022-05-23 04:35:14 -04:00
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
2022-06-29 09:26:29 -04:00
|
|
|
BYPRODUCTS bootstrapper
|
2022-05-23 04:35:14 -04:00
|
|
|
)
|
2022-03-22 11:03:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# cli
|
|
|
|
#
|
|
|
|
|
|
|
|
add_custom_target(cli ALL
|
2022-07-11 09:19:56 -04:00
|
|
|
CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/constellation -tags=gcp -ldflags "-buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${CLI_VERSION}"
|
2022-05-23 04:35:14 -04:00
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cli
|
|
|
|
BYPRODUCTS constellation
|
|
|
|
)
|
2022-03-22 11:03:15 -04:00
|
|
|
|
|
|
|
#
|
|
|
|
# testing / debugging
|
|
|
|
#
|
|
|
|
|
2022-06-29 09:26:29 -04:00
|
|
|
add_custom_target(debug_bootstrapper
|
|
|
|
go build -o ${CMAKE_BINARY_DIR}/debug_bootstrapper -buildvcs=false -ldflags "-buildid='' -X main.version=${PROJECT_VERSION}"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bootstrapper/cmd/bootstrapper
|
|
|
|
BYPRODUCTS debug_bootstrapper
|
2022-05-23 04:35:14 -04:00
|
|
|
)
|
|
|
|
|
2022-05-23 06:13:23 -04:00
|
|
|
#
|
|
|
|
# debugd
|
|
|
|
#
|
|
|
|
|
|
|
|
add_custom_target(debugd ALL
|
|
|
|
CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/debugd -buildvcs=false -ldflags "-buildid=''"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/debugd/debugd/cmd/debugd
|
|
|
|
BYPRODUCTS debugd
|
|
|
|
)
|
|
|
|
|
|
|
|
#
|
|
|
|
# cdbg
|
|
|
|
#
|
|
|
|
|
|
|
|
add_custom_target(cdbg ALL
|
|
|
|
CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/cdbg -buildvcs=false -ldflags "-buildid=''"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/debugd/cdbg
|
|
|
|
BYPRODUCTS cdbg
|
|
|
|
)
|
2022-03-22 11:03:15 -04:00
|
|
|
|
2022-06-30 07:26:21 -04:00
|
|
|
add_test(NAME unit-main COMMAND go test -race -count=3 ./... WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
|
|
|
add_test(NAME unit-hack COMMAND go test -race -count=3 ./... WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/hack)
|
2022-08-08 09:50:37 -04:00
|
|
|
add_test(NAME unit-node-operator COMMAND go test -race -count=3 ./... WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/operators/constellation-node-operator)
|
|
|
|
add_test(NAME integration-node-operator COMMAND make test WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/operators/constellation-node-operator)
|
|
|
|
add_test(NAME integration-mount COMMAND bash -c "go test -tags integration -c ./test/ && sudo ./test.test -test.v -v 9" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/mount)
|
|
|
|
add_test(NAME integration-dm COMMAND bash -c "go test -tags integration -c ./test/ && sudo ./test.test -test.v" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/state/internal)
|