@@ -30,7 +30,6 @@ project(
3030 LANGUAGES C
3131)
3232
33- include (CheckLibraryExists)
3433include (CheckSymbolExists)
3534include (CMakeDependentOption)
3635include (CMakePushCheckState)
@@ -74,8 +73,8 @@ target_sources(
7473)
7574
7675# Add -Wno-strict-prototypes as depends on user libs.
77- php_check_compiler_flag(C -Wno-strict-prototypes HAVE_WNO_STRICT_PROTOTYPES_C )
78- if (HAVE_WNO_STRICT_PROTOTYPES_C )
76+ php_check_compiler_flag(C -Wno-strict-prototypes _PHP_HAVE_WNO_STRICT_PROTOTYPES )
77+ if (_PHP_HAVE_WNO_STRICT_PROTOTYPES )
7978 target_compile_options (
8079 php_ext_readline
8180 PRIVATE
@@ -94,41 +93,41 @@ set_package_properties(
9493target_link_libraries (php_ext_readline PUBLIC Editline::Editline)
9594
9695if (TARGET Editline::Editline)
97- check_library_exists(
98- Editline::Editline
99- rl_callback_read_char
100- ""
101- HAVE_RL_CALLBACK_READ_CHAR
102- )
103- check_library_exists(
104- Editline::Editline
105- rl_on_new_line
106- ""
107- HAVE_RL_ON_NEW_LINE
108- )
109- check_library_exists(
110- Editline::Editline
111- rl_completion_matches
112- ""
113- HAVE_RL_COMPLETION_MATCHES
114- )
115- check_library_exists(
116- Editline::Editline
117- history_list
118- ""
119- HAVE_HISTORY_LIST
120- )
96+ cmake_push_check_state(RESET)
97+ set (CMAKE_REQUIRED_LIBRARIES Editline::Editline)
98+
99+ check_symbol_exists(
100+ rl_callback_read_char
101+ editline/readline.h
102+ HAVE_RL_CALLBACK_READ_CHAR
103+ )
104+
105+ check_symbol_exists(
106+ rl_on_new_line
107+ editline/readline.h
108+ HAVE_RL_ON_NEW_LINE
109+ )
110+
111+ check_symbol_exists(
112+ rl_completion_matches
113+ editline/readline.h
114+ HAVE_RL_COMPLETION_MATCHES
115+ )
116+
117+ check_symbol_exists(
118+ history_list
119+ editline/readline.h
120+ HAVE_HISTORY_LIST
121+ )
122+
123+ check_symbol_exists(
124+ rl_erase_empty_line
125+ editline/readline.h
126+ HAVE_ERASE_EMPTY_LINE
127+ )
128+ cmake_pop_check_state()
121129endif ()
122130
123131set (HAVE_LIBEDIT TRUE )
124132
125- cmake_push_check_state(RESET)
126- set (CMAKE_REQUIRED_LIBRARIES Editline::Editline)
127- check_symbol_exists(
128- rl_erase_empty_line
129- editline/readline.h
130- HAVE_ERASE_EMPTY_LINE
131- )
132- cmake_pop_check_state()
133-
134133configure_file (cmake/config.h.in config.h)
0 commit comments