Skip to content

Commit 582aaf5

Browse files
committed
ext/pdo_firebird: Use CheckSymbolExists
1 parent 5e99eab commit 582aaf5

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

cmake/ext/pdo_firebird/CMakeLists.txt

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

30-
include(CheckLibraryExists)
30+
include(CheckSymbolExists)
3131
include(CMakeDependentOption)
32+
include(CMakePushCheckState)
3233
include(FeatureSummary)
3334

3435
option(PHP_EXT_PDO_FIREBIRD "Enable the pdo_firebird extension")
@@ -85,13 +86,16 @@ target_link_libraries(php_ext_pdo_firebird PRIVATE Firebird::Firebird)
8586

8687
# Sanity check.
8788
if(TARGET Firebird::Firebird)
88-
check_library_exists(
89-
Firebird::Firebird
90-
isc_detach_database
91-
""
92-
_php_ext_pdo_firebird_sanity_check
93-
)
94-
if(NOT _php_ext_pdo_firebird_sanity_check)
89+
cmake_push_check_state(RESET)
90+
set(CMAKE_REQUIRED_LIBRARIES Firebird::Firebird)
91+
check_symbol_exists(
92+
isc_detach_database
93+
ibase.h
94+
_PHP_EXT_PDO_FIREBIRD_SANITY_CHECK
95+
)
96+
cmake_pop_check_state()
97+
98+
if(NOT _PHP_EXT_PDO_FIREBIRD_SANITY_CHECK)
9599
message(
96100
FATAL_ERROR
97101
"Firebird sanity check failed: 'isc_detach_database()' not found."

0 commit comments

Comments
 (0)