2023-07-13 08:37:36 +03:00
|
|
|
# Copyright (c) Microsoft Corporation.
|
|
|
|
# Licensed under the MIT License.
|
2022-01-20 21:09:06 +03:00
|
|
|
#
|
|
|
|
# Defines utility functions to create build targets for CI.
|
|
|
|
#
|
|
|
|
|
2022-03-22 04:39:39 +03:00
|
|
|
##
|
|
|
|
# Adds a target to be built as part of a CI run
|
|
|
|
# - param service: The Azure SDK service group
|
|
|
|
# - param target: The name of the cmake target to be built
|
|
|
|
macro(create_per_service_target_build service target)
|
2022-01-20 21:09:06 +03:00
|
|
|
|
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/${service}-targets-build.txt "${target}\n")
|
|
|
|
|
|
|
|
endmacro()
|
2022-03-22 04:39:39 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# Adds a target to be built and also run during a CI run
|
|
|
|
# - param service: The Azure SDK service group
|
|
|
|
# - param target: The name of the cmake target to be built
|
|
|
|
macro(create_per_service_target_build_for_sample service target)
|
|
|
|
|
|
|
|
# Create the built target
|
|
|
|
create_per_service_target_build(${service} ${target})
|
|
|
|
|
|
|
|
# Assume the sample to be run on Release mode
|
|
|
|
SET(binary "${target}")
|
|
|
|
if(MSVC)
|
|
|
|
SET(binary "${target}.exe")
|
|
|
|
endif()
|
|
|
|
# Samples are run on Release mode.
|
|
|
|
if(CMAKE_GENERATOR MATCHES "Visual Studio.*")
|
|
|
|
SET(binary "Release/${binary}")
|
|
|
|
endif()
|
|
|
|
file(APPEND ${CMAKE_BINARY_DIR}/${service}-samples.txt "${CMAKE_CURRENT_BINARY_DIR}/${binary}\n")
|
|
|
|
|
|
|
|
endmacro()
|