Skip to content

Commit 3e1164b

Browse files
committed
Prevent building always-enabled PHP extensions as standalone
1 parent e45bd71 commit 3e1164b

File tree

8 files changed

+64
-0
lines changed

8 files changed

+64
-0
lines changed

cmake/ext/date/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ project(
1515
LANGUAGES C
1616
)
1717

18+
if(PROJECT_IS_TOP_LEVEL)
19+
message(
20+
FATAL_ERROR
21+
"The PHP date extension is intended to be built only within the "
22+
"top-level PHP source tree (php-src)."
23+
)
24+
endif()
25+
1826
include(FeatureSummary)
1927

2028
add_feature_info(

cmake/ext/hash/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ project(
2323
LANGUAGES C
2424
)
2525

26+
if(PROJECT_IS_TOP_LEVEL)
27+
message(
28+
FATAL_ERROR
29+
"The PHP hash extension is intended to be built only within the "
30+
"top-level PHP source tree (php-src)."
31+
)
32+
endif()
33+
2634
include(FeatureSummary)
2735
include(PHP/CheckCompilerFlag)
2836

cmake/ext/json/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ project(
1414
LANGUAGES C
1515
)
1616

17+
if(PROJECT_IS_TOP_LEVEL)
18+
message(
19+
FATAL_ERROR
20+
"The PHP json extension is intended to be built only within the "
21+
"top-level PHP source tree (php-src)."
22+
)
23+
endif()
24+
1725
include(FeatureSummary)
1826

1927
add_feature_info(

cmake/ext/pcre/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ project(
3131
LANGUAGES C
3232
)
3333

34+
if(PROJECT_IS_TOP_LEVEL)
35+
message(
36+
FATAL_ERROR
37+
"The PHP pcre extension is intended to be built only within the "
38+
"top-level PHP source tree (php-src)."
39+
)
40+
endif()
41+
3442
include(CheckSourceRuns)
3543
include(CheckSymbolExists)
3644
include(CMakePushCheckState)

cmake/ext/random/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ project(
1414
LANGUAGES C
1515
)
1616

17+
if(PROJECT_IS_TOP_LEVEL)
18+
message(
19+
FATAL_ERROR
20+
"The PHP random extension is intended to be built only inside the PHP top "
21+
"level project (php-src)."
22+
)
23+
endif()
24+
1725
include(CheckIncludeFiles)
1826
include(CheckSymbolExists)
1927
include(FeatureSummary)

cmake/ext/reflection/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ project(
1414
LANGUAGES C
1515
)
1616

17+
if(PROJECT_IS_TOP_LEVEL)
18+
message(
19+
FATAL_ERROR
20+
"The PHP reflection extension is intended to be built only within the "
21+
"top-level PHP source tree (php-src)."
22+
)
23+
endif()
24+
1725
include(FeatureSummary)
1826

1927
add_feature_info(

cmake/ext/spl/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ project(
1313
LANGUAGES C
1414
)
1515

16+
if(PROJECT_IS_TOP_LEVEL)
17+
message(
18+
FATAL_ERROR
19+
"The PHP spl extension is intended to be built only within the "
20+
"top-level PHP source tree (php-src)."
21+
)
22+
endif()
23+
1624
include(FeatureSummary)
1725

1826
add_feature_info(

cmake/ext/standard/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ project(
2727
LANGUAGES C
2828
)
2929

30+
if(PROJECT_IS_TOP_LEVEL)
31+
message(
32+
FATAL_ERROR
33+
"The PHP standard extension is intended to be built only within the "
34+
"top-level PHP source tree (php-src)."
35+
)
36+
endif()
37+
3038
include(CheckIncludeFiles)
3139
include(CheckSymbolExists)
3240
include(FeatureSummary)

0 commit comments

Comments
 (0)