mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 02:39:07 +08:00
47633daa65
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.
21 lines
1007 B
CMake
21 lines
1007 B
CMake
if(CMAKE_HOST_WIN32)
|
|
# This download shall be the same as in vcpkg_find_acquire_program(FLEX).cmake
|
|
set(program_version 2.5.25)
|
|
set(download_urls "https://github.com/lexxmark/winflexbison/releases/download/v${program_version}/win_flex_bison-${program_version}.zip")
|
|
set(download_filename "win_flex_bison-${program_version}.zip")
|
|
set(download_sha512 2a829eb05003178c89f891dd0a67add360c112e74821ff28e38feb61dac5b66e9d3d5636ff9eef055616aaf282ee8d6be9f14c6ae4577f60bdcec96cec9f364e)
|
|
set(tool_subdirectory "${program_version}")
|
|
set(program_name win_bison)
|
|
set(paths_to_search "${DOWNLOADS}/tools/win_flex/${program_version}")
|
|
if(NOT EXISTS "${paths_to_search}/data/m4sugar/m4sugar.m4")
|
|
file(REMOVE_RECURSE "${paths_to_search}")
|
|
endif()
|
|
else()
|
|
set(program_name bison)
|
|
set(apt_package_name bison)
|
|
set(brew_package_name bison)
|
|
if (CMAKE_HOST_APPLE)
|
|
set(paths_to_search /opt/homebrew/opt/bison/bin /usr/local/opt/bison/bin)
|
|
endif()
|
|
endif()
|