Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 62 additions & 21 deletions scripts/test_ports/vcpkg-find-acquire-program/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,21 +1,62 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

if(CMAKE_HOST_WIN32)
foreach(PROG GO JOM NASM PERL YASM GIT PYTHON3 PYTHON2 RUBY 7Z NUGET FLEX BISON GPERF GASPREPROCESSOR DARK SCONS SWIG DOXYGEN ARIA2 PKGCONFIG)
vcpkg_find_acquire_program(${PROG})
foreach(SUBPROG IN LISTS ${PROG})
if(NOT EXISTS "${SUBPROG}")
message(FATAL_ERROR "Program ${SUBPROG} did not exist.")
endif()
endforeach()
endforeach()
endif()

foreach(PROG GN NINJA MESON BAZEL)
vcpkg_find_acquire_program(${PROG})
foreach(SUBPROG IN LISTS ${PROG})
if(NOT EXISTS "${SUBPROG}")
message(FATAL_ERROR "Program ${SUBPROG} did not exist.")
endif()
endforeach()
endforeach()
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

# For each vcpkg_find_acquire_program(NAME).cmake script,
# there must be a literal call to vcpkg_find_acquire_program(NAME).cmake

set(variables BAZEL BISON FLEX GIT GN NINJA PERL PKGCONFIG PYTHON2 PYTHON3 YASM)
vcpkg_find_acquire_program(BAZEL)
vcpkg_find_acquire_program(BISON)
vcpkg_find_acquire_program(FLEX)
vcpkg_find_acquire_program(GIT)
vcpkg_find_acquire_program(GN)
vcpkg_find_acquire_program(NINJA)
vcpkg_find_acquire_program(PERL)
vcpkg_find_acquire_program(PKGCONFIG)
vcpkg_find_acquire_program(PYTHON2)
vcpkg_find_acquire_program(PYTHON3)
vcpkg_find_acquire_program(YASM)

if(NOT VCPKG_TARGET_IS_OSX)
# System python too old (3.9; meson needs 3.10)
list(APPEND variables MESON)
vcpkg_find_acquire_program(MESON)
endif()

if(VCPKG_HOST_IS_LINUX)
list(APPEND variables PATCHELF)
vcpkg_find_acquire_program(PATCHELF)
endif()

if(VCPKG_HOST_IS_WINDOWS)
list(APPEND variables 7Z ARIA2 CLANG DARK DOXYGEN GASPREPROCESSOR GO GPERF JOM NASM NUGET RUBY SCONS SWIG)
vcpkg_find_acquire_program(7Z)
vcpkg_find_acquire_program(ARIA2)
vcpkg_find_acquire_program(CLANG)
vcpkg_find_acquire_program(DARK)
vcpkg_find_acquire_program(DOXYGEN)
vcpkg_find_acquire_program(GASPREPROCESSOR)
vcpkg_find_acquire_program(GO)
vcpkg_find_acquire_program(GPERF)
vcpkg_find_acquire_program(JOM)
vcpkg_find_acquire_program(NASM)
vcpkg_find_acquire_program(NUGET)
vcpkg_find_acquire_program(RUBY)
vcpkg_find_acquire_program(SCONS)
vcpkg_find_acquire_program(SWIG)
endif()

set(missing "")
foreach(variable IN LISTS variables)
list(POP_BACK "${variable}" program)
if(NOT EXISTS "${program}")
list(APPEND missing "${variable}: ${program}")
endif()
list(POP_FRONT "${variable}" interpreter)
if(interpreter AND NOT EXISTS "${interpreter}")
list(APPEND missing "${variable} (interpreter): ${interpreter}")
endif()
endforeach()
if(missing)
list(JOIN missing "\n " missing)
message(FATAL_ERROR "The following programs do not exist:\n ${missing}")
endif()
2 changes: 1 addition & 1 deletion scripts/test_ports/vcpkg-find-acquire-program/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"version-string": "0",
"port-version": 1,
"description": "Test port to exercise vcpkg_find_acquire_program",
"supports": "windows"
"supports": "native"
}