Skip to content

Commit 1ab5b27

Browse files
committed
ext/odbc: Use regular cache variable for PHP_EXT_ODBC_VERSION
This avoids using PHP/Set module.
1 parent 674aaf6 commit 1ab5b27

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

cmake/ext/odbc/CMakeLists.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,20 @@ if(
252252
)
253253
endif()
254254

255-
php_set(
256-
PHP_EXT_ODBC_VERSION
257-
TYPE STRING
258-
IF [[PHP_EXT_ODBC AND NOT PHP_EXT_ODBC_TYPE MATCHES "^(unixODBC|dbmaker)$"]]
259-
VALUE "0x0350"
260-
ELSE_VALUE "0x0350"
261-
DOC
262-
"Hex number to force support for the ODBC specification version. Default: "
263-
"0x0350. Set to special value 0 (zero) or empty to not define explicit "
264-
"ODBCVER in the configuration header."
265-
)
266-
mark_as_advanced(PHP_EXT_ODBC_VERSION)
255+
if(PHP_EXT_ODBC_TYPE MATCHES "^(unixODBC|dbmaker)$")
256+
set(PHP_EXT_ODBC_VERSION "0x0350")
257+
else()
258+
set(
259+
CACHE{PHP_EXT_ODBC_VERSION}
260+
TYPE STRING
261+
HELP
262+
"Hex number to force support for the ODBC specification version. Default: "
263+
"0x0350. Set to special value 0 (zero) or empty to not define explicit "
264+
"ODBCVER in the configuration header."
265+
VALUE "0x0350"
266+
)
267+
mark_as_advanced(PHP_EXT_ODBC_VERSION)
268+
endif()
267269
# Validate hexadecimal version.
268270
if(PHP_EXT_ODBC_VERSION AND NOT PHP_EXT_ODBC_VERSION MATCHES "^0x[0-9A-Fa-f]+$")
269271
message(

0 commit comments

Comments
 (0)