formula: trap CMake FetchContent usage instead of using FETCHCONTENT_FULLY_DISCONNECTED
This commit is contained in:
parent
b8d844ced8
commit
920364ca87
16
Library/Homebrew/cmake/trap_fetchcontent_provider.cmake
Normal file
16
Library/Homebrew/cmake/trap_fetchcontent_provider.cmake
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.24) # Dependency providers introduced in CMake 3.24
|
||||||
|
|
||||||
|
option(HOMEBREW_ALLOW_FETCHCONTENT "Allow FetchContent to be used in Homebrew builds" OFF)
|
||||||
|
|
||||||
|
if (HOMEBREW_ALLOW_FETCHCONTENT)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
macro(trap_fetchcontent_provider method depName)
|
||||||
|
message(FATAL_ERROR "Refusing to populate dependency '${depName}' with FetchContent while building in Homebrew, please use a formula dependency or add a resource to the formula.")
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
cmake_language(
|
||||||
|
SET_DEPENDENCY_PROVIDER trap_fetchcontent_provider
|
||||||
|
SUPPORTED_METHODS FETCHCONTENT_MAKEAVAILABLE_SERIAL
|
||||||
|
)
|
@ -1808,7 +1808,7 @@ class Formula
|
|||||||
-DCMAKE_BUILD_TYPE=Release
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
-DCMAKE_FIND_FRAMEWORK=#{find_framework}
|
-DCMAKE_FIND_FRAMEWORK=#{find_framework}
|
||||||
-DCMAKE_VERBOSE_MAKEFILE=ON
|
-DCMAKE_VERBOSE_MAKEFILE=ON
|
||||||
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
|
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=#{HOMEBREW_LIBRARY_PATH}/cmake/trap_fetchcontent_provider.cmake
|
||||||
-Wno-dev
|
-Wno-dev
|
||||||
-DBUILD_TESTING=OFF
|
-DBUILD_TESTING=OFF
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user