vcpkg/scripts/cmake/vcpkg_build_ninja.cmake
Robert Schumacher 7d2449c346
[docs] Delete embedded documentation in favor of docs/ (#25096)
* [docs] Delete embedded documentation in favor of docs/

Drive-by for the helper ports:
1. "documentation": "https://vcpkg.io/en/docs/README.html"
2. "license": "MIT"
3. Use `include_guard(GLOBAL)` in all script files
4. Make sure any persistent variables are saved to the cache

* [docs] Restore empty regenerate.ps1 to satisfy Azure Pipelines

* [docs] PR comments
2022-06-07 16:26:51 -07:00

31 lines
1008 B
CMake

function(z_vcpkg_build_ninja_build config targets)
message(STATUS "Building (${config})...")
vcpkg_execute_build_process(
COMMAND "${NINJA}" -C "${CURRENT_BUILDTREES_DIR}/${config}" ${targets}
WORKING_DIRECTORY "${SOURCE_PATH}"
LOGNAME "build-${config}"
)
endfunction()
function(vcpkg_build_ninja)
cmake_parse_arguments(PARSE_ARGV 0 arg "" "" "TARGETS")
if(DEFINED arg_UNPARSED_ARGUMENTS)
message(WARNING "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
endif()
if(NOT DEFINED arg_TARGETS)
set(arg_TARGETS "")
endif()
vcpkg_find_acquire_program(NINJA)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
z_vcpkg_build_ninja_build("${TARGET_TRIPLET}-dbg" "${arg_TARGETS}")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
z_vcpkg_build_ninja_build("${TARGET_TRIPLET}-rel" "${arg_TARGETS}")
endif()
endfunction()