vcpkg/scripts/cmake
Kai Pastor 47633daa65
[vcpkg-scripts] Catch use of ambiguous cmake vars (#34546)
Avoid wrong use of popular but ambiguous variables (`WIN32` etc.) in
scripts and portfiles by detection in CI.

Sometimes the variables are used wrongly, and sometimes this isn't
caught in PR review. This PR tries to catch those variables (when in the
active code path in script mode). [This can happen to every
contributor](https://github.com/microsoft/vcpkg/pull/34356#discussion_r1360074122),
even if he/she knows the rules ... vcpkg is raising the bar higher than
usual, having to deal with targets and hosts even in script mode.

(`b2-options.cmake` (boost fragment) shows where we get if we don't pay
attention: the same code being used in script mode (`WIN32` meaning
host) and in project mode (`WIN32` meaning target).)

The new check doesn't break any user builds because it relies on command
line options. However it changes the ABI hashes.
2024-06-14 11:40:01 -07:00
..
compile_wrapper_consider_clang-cl.patch scripts/msys => scripts/cmake (#32375) 2023-07-27 13:19:40 -07:00
execute_process.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_acquire_msys.cmake [vcpkg scripts] Update msys2 (#39088) 2024-06-10 15:38:54 -07:00
vcpkg_add_to_path.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_apply_patches.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_backup_restore_env_vars.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_build_cmake.cmake [vcpkg] GENERATOR with Makefiles can build parallel (#26780) 2022-10-08 21:48:41 -07:00
vcpkg_build_make.cmake [vcpkg-scripts] Catch use of ambiguous cmake vars (#34546) 2024-06-14 11:40:01 -07:00
vcpkg_build_msbuild.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_build_ninja.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_build_nmake.cmake [scripts|nmake] Add jom option, add language control (#27255) 2022-11-02 11:32:43 -07:00
vcpkg_build_qmake.cmake [qt5] MinGW build fixes (#29505) 2023-02-22 13:17:37 -08:00
vcpkg_buildpath_length_warning.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_check_features.cmake [vcpkg scripts] Fix check the different features have the same feature variable in function vcpkg_check_features (#31984) 2023-07-21 09:04:10 -07:00
vcpkg_check_linkage.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_clean_executables_in_bin.cmake [vcpkg_clean_executables_in_bin] Clean bundles (#28335) 2022-12-14 18:23:44 -08:00
vcpkg_clean_msbuild.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_common_definitions.cmake Update vcpkg-tool to 2023-06-07 + xbox triplets cleanup (#31723) 2023-06-08 11:17:29 -07:00
vcpkg_common_functions.cmake [scripts audit] ports.cmake (#16257) 2021-02-18 14:27:41 -08:00
vcpkg_configure_cmake.cmake Update vcpkg-tool to 2023-06-07 + xbox triplets cleanup (#31723) 2023-06-08 11:17:29 -07:00
vcpkg_configure_gn.cmake [gn-related-ports] Fix gn based projects build error on Windows (#29058) 2023-01-26 18:53:54 -08:00
vcpkg_configure_make.cmake Minor updates to comments for some verbiage that gets flagged by political correctness tools (#38719) 2024-06-14 11:35:12 -07:00
vcpkg_configure_meson.cmake [vcpkg-scripts] Catch use of ambiguous cmake vars (#34546) 2024-06-14 11:40:01 -07:00
vcpkg_configure_qmake.cmake [z_vcpkg_setup_pkgconfig_path] debug needs share/pkgconfig (#36151) 2024-03-01 16:35:37 -08:00
vcpkg_copy_pdbs.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_copy_tool_dependencies.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_copy_tools.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_download_distfile.cmake [vcpkg] fix proxy hint that should be fixed long time ago (#29346) 2023-02-08 13:51:10 -08:00
vcpkg_download_sourceforge.cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_execute_build_process.cmake [vcpkg] Enhance detection of AV messing with builds (#33279) 2023-08-29 00:18:59 -07:00
vcpkg_execute_in_download_mode.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_execute_required_process_repeat.cmake Audit use of TO_NATIVE_PATH. (#26201) 2022-08-12 15:21:20 -07:00
vcpkg_execute_required_process.cmake [scripts|world rebuild] Disambiguate saved log files (#26754) 2023-01-09 11:13:59 -08:00
vcpkg_extract_archive.cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_extract_source_archive_ex.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_extract_source_archive.cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_fail_port_install.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_find_acquire_program.cmake Run python in isolate mode (#35990) 2024-01-11 15:32:36 -08:00
vcpkg_find_acquire_program(7Z).cmake [7zip] Update to 24.06 (#38790) 2024-06-11 12:16:41 -07:00
vcpkg_find_acquire_program(ARIA2).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(BAZEL).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(BISON).cmake [vcpkg-scripts] Catch use of ambiguous cmake vars (#34546) 2024-06-14 11:40:01 -07:00
vcpkg_find_acquire_program(CLANG).cmake [vcpkg_find_acquire_program] Split out data (#30780) 2023-04-14 02:19:52 -07:00
vcpkg_find_acquire_program(DARK).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(DOXYGEN).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(FLEX).cmake [vcpkg_find_acquire_program] Split out data (#30780) 2023-04-14 02:19:52 -07:00
vcpkg_find_acquire_program(GASPREPROCESSOR).cmake [vcpkg_find_acquire_program] Split out data (#30780) 2023-04-14 02:19:52 -07:00
vcpkg_find_acquire_program(GIT).cmake [vcpkg_find_acquire_program] Split out data (#30780) 2023-04-14 02:19:52 -07:00
vcpkg_find_acquire_program(GN).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(GO).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(GPERF).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(JOM).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(MESON).cmake [vcpkg-tool-meson] Update meson to 1.3.2 (#28084) 2024-03-11 14:09:15 -07:00
vcpkg_find_acquire_program(NASM).cmake [vcpkg_find_acquire(NASM).cmake] add nasm mirror (#38597) 2024-05-09 13:07:20 -07:00
vcpkg_find_acquire_program(NINJA).cmake Allow uname calls in download mode + Fix handling of files without RPATH (#37129) 2024-03-07 15:19:17 -08:00
vcpkg_find_acquire_program(NUGET).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(PATCHELF).cmake Allow uname calls in download mode + Fix handling of files without RPATH (#37129) 2024-03-07 15:19:17 -08:00
vcpkg_find_acquire_program(PERL).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(PKGCONFIG).cmake [vcpkg scripts] Update msys2 pkgconf to 2.2.0 (#37844) 2024-04-01 13:37:39 -07:00
vcpkg_find_acquire_program(PYTHON2).cmake [vcpkg_find_acquire_program] Split out data (#30780) 2023-04-14 02:19:52 -07:00
vcpkg_find_acquire_program(PYTHON3).cmake [python3] Update to 3.11.8 (#36755) 2024-03-05 01:29:47 -08:00
vcpkg_find_acquire_program(RUBY).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(SCONS).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(SWIG).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_acquire_program(YASM).cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_find_fortran.cmake [vcpkg-scripts] Catch use of ambiguous cmake vars (#34546) 2024-06-14 11:40:01 -07:00
vcpkg_fixup_cmake_targets.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_fixup_pkgconfig.cmake [vcpkg_fixup_pkgconfig] Fix lib names starting with debug/optimized/general (#39227) 2024-06-13 00:37:56 -07:00
vcpkg_from_bitbucket.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_from_git.cmake [vcpkg_from_git] Improve diagnostics. (#36539) 2024-03-06 11:28:35 -08:00
vcpkg_from_github.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_from_gitlab.cmake [vcpkg] Fix GitLab authentication token (#34151) 2023-10-06 16:47:19 -07:00
vcpkg_from_sourceforge.cmake Improve and extract internals of vcpkg_find_acquire_program. (#34881) 2023-11-14 14:01:08 -08:00
vcpkg_get_program_files_platform_bitness.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_get_windows_sdk.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_host_path_list.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_install_cmake.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_install_copyright.cmake [vcpkg] Add vcpkg_install_copyright() portfile function (#25239) 2022-07-13 09:41:52 -07:00
vcpkg_install_gn.cmake [gn-related-ports] Fix gn based projects build error on Windows (#29058) 2023-01-26 18:53:54 -08:00
vcpkg_install_make.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_install_meson.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_install_msbuild.cmake [vcpkg baseline][marisa-trie] Fix conflict file include/Makefile.am with hunspell (#28352) 2023-01-04 12:11:05 -08:00
vcpkg_install_nmake.cmake [scripts|nmake] Add jom option, add language control (#27255) 2022-11-02 11:32:43 -07:00
vcpkg_install_qmake.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_list.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_minimum_required.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_replace_string.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
vcpkg_test_cmake.cmake [scripts audit] ports.cmake (#16257) 2021-02-18 14:27:41 -08:00
z_vcpkg_apply_patches.cmake [z_vcpkg_apply_patches] core.filemode=true (#32392) 2023-07-06 11:28:54 -07:00
z_vcpkg_escape_regex_control_characters.cmake [scripts-audit] Rollup 2021-05-21 (#18112) 2021-05-26 13:40:48 -07:00
z_vcpkg_fixup_rpath.cmake [vcpkg-scripts] Fix rpath fixup; add test (#37964) 2024-04-23 15:09:16 -04:00
z_vcpkg_forward_output_variable.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
z_vcpkg_function_arguments.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
z_vcpkg_get_cmake_vars.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
z_vcpkg_prettify_command_line.cmake [docs] Delete embedded documentation in favor of docs/ (#25096) 2022-06-07 16:26:51 -07:00
z_vcpkg_setup_pkgconfig_path.cmake [vcpkg/scripts] Only add pkgconfig_path if it is not already on PATH (#38239) 2024-04-20 16:20:27 -04:00