mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 05:46:38 +02:00
Merge pull request #1069 from adsr/master
php: use find_library to find libphp7.so
This commit is contained in:
+16
-4
@@ -38,10 +38,22 @@ if(NOT PHP_FOUND)
|
||||
execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --libs OUTPUT_VARIABLE PHP_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${PHP_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE PHP_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(${PHP_VERSION} MATCHES "^7")
|
||||
string(REPLACE "-I" "" PHP_INCLUDE_DIRS ${PHP_INCLUDE_DIRS})
|
||||
SEPARATE_ARGUMENTS(PHP_INCLUDE_DIRS)
|
||||
set(PHP_LDFLAGS "-L${PHP_LIB_PREFIX}/lib/ ${PHP_LIBS} -lphp7")
|
||||
set(PHP_FOUND 1)
|
||||
find_library(PHP_LIB php7 HINTS ${PHP_LIB_PREFIX} ${PHP_LIB_PREFIX}/lib ${PHP_LIB_PREFIX}/lib64)
|
||||
if(PHP_LIB)
|
||||
get_filename_component(PHP_LIB_DIR ${PHP_LIB} DIRECTORY)
|
||||
string(REPLACE "-I" "" PHP_INCLUDE_DIRS ${PHP_INCLUDE_DIRS})
|
||||
SEPARATE_ARGUMENTS(PHP_INCLUDE_DIRS)
|
||||
set(PHP_LDFLAGS "-L${PHP_LIB_DIR} ${PHP_LIBS} -lphp7")
|
||||
set(PHP_FOUND 1)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT PHP_FOUND)
|
||||
message(WARNING "Could not find libphp7. "
|
||||
"Ensure PHP >=7.0.0 development libraries are installed and compiled with `--enable-embed`. "
|
||||
"Ensure `php-config` is in `PATH`. "
|
||||
"You may set `-DCMAKE_LIBRARY_PATH=...` to the directory containing libphp7."
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -1090,8 +1090,15 @@ php_weechat_sapi_error (int type, const char *format, ...)
|
||||
}
|
||||
|
||||
void
|
||||
#if PHP_MINOR_VERSION >= 1
|
||||
php_weechat_log_message (char *message, int syslog_type_int)
|
||||
#else
|
||||
php_weechat_log_message (char *message)
|
||||
#endif
|
||||
{
|
||||
#if PHP_MINOR_VERSION >= 1
|
||||
(void)syslog_type_int;
|
||||
#endif
|
||||
php_weechat_ub_write (message, strlen (message));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user