mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-24 06:59:40 -05:00
5b40e0cc77
* move debugd code into internal folder * Fix paths in CMakeLists.txt Signed-off-by: Fabian Kammel <fk@edgeless.systems>
76 lines
2.7 KiB
CMake
76 lines
2.7 KiB
CMake
cmake_minimum_required(VERSION 3.11)
|
|
project(constellation LANGUAGES C VERSION 0.1.0)
|
|
|
|
set(CLI_VERSION "v0.1.0" CACHE STRING "Version of CLI binary.")
|
|
set(CLI_BUILD_TAGS "gcp" CACHE STRING "Tags passed to go build of Constellation CLI.")
|
|
|
|
enable_testing()
|
|
|
|
#
|
|
# core-os disk-mapper
|
|
#
|
|
add_custom_target(disk-mapper ALL
|
|
DOCKER_BUILDKIT=1 docker build -o ${CMAKE_BINARY_DIR} -f Dockerfile.build --target disk-mapper .
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
BYPRODUCTS disk-mapper
|
|
)
|
|
|
|
#
|
|
# bootstrapper
|
|
#
|
|
|
|
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 .
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
BYPRODUCTS bootstrapper
|
|
)
|
|
|
|
|
|
#
|
|
# cli
|
|
#
|
|
|
|
add_custom_target(cli ALL
|
|
CGO_ENABLED=0 go build -o ${CMAKE_BINARY_DIR}/constellation -tags='${CLI_BUILD_TAGS}' -ldflags "-buildid='' -X github.com/edgelesssys/constellation/internal/constants.VersionInfo=${CLI_VERSION}"
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cli
|
|
BYPRODUCTS constellation
|
|
)
|
|
|
|
#
|
|
# testing / debugging
|
|
#
|
|
|
|
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
|
|
)
|
|
|
|
#
|
|
# 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/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/cmd/cdbg
|
|
BYPRODUCTS cdbg
|
|
)
|
|
|
|
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)
|
|
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" 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)
|
|
add_test(NAME integration-license COMMAND bash -c "go test -tags integration" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/internal/license)
|