@@ -40,7 +40,8 @@ set(PROXYRES_HDRS
4040 include/proxyres/config.h
4141 include/proxyres/log.h
4242 include/proxyres/proxyres.h
43- include/proxyres/resolver.h)
43+ include/proxyres/resolver.h
44+ ${PROJECT_BINARY_DIR} /proxyres_config.h)
4445if (PROXYRES_EXECUTE)
4546 list (APPEND PROXYRES_HDRS
4647 include /proxyres/execute.h)
@@ -254,24 +255,25 @@ if(PROXYRES_USE_CXX)
254255 endif ()
255256endif ()
256257
258+ if (NOT WIN32 )
259+ check_include_file ("net/if_arp.h" HAVE_NET_IF_ARP_H )
260+ check_include_file ("netdb.h" HAVE_NETDB_H )
261+ endif ()
262+
263+ configure_file (proxyres_config.h.in proxyres_config.h @ONLY NEWLINE_STYLE UNIX )
264+
257265add_library (proxyres ${PROXYRES_HDRS} ${PROXYRES_SRCS} ${PROXYRES_C_SRCS} )
258266set_property (TARGET proxyres PROPERTY C_STANDARD 11 CXX_STANDARD 11 )
259267if (PROXYRES_BUILD_TESTS)
260268 target_compile_definitions (proxyres PRIVATE PROXYRES_TESTING )
261269endif ()
262270target_include_directories (proxyres PRIVATE
263271 ${CMAKE_CURRENT_SOURCE_DIR}
264- ${CMAKE_CURRENT_SOURCE_DIR} /include/proxyres )
272+ ${CMAKE_CURRENT_SOURCE_DIR} /include/proxyres
273+ ${PROJECT_BINARY_DIR} )
265274target_include_directories (proxyres PUBLIC
266275 $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /include >)
267276
268- if (NOT WIN32 )
269- check_include_file ("net/if_arp.h" HAVE_NET_IF_ARP_H )
270- if (HAVE_NET_IF_ARP_H)
271- target_compile_definitions (proxyres PRIVATE HAVE_NET_IF_ARP_H )
272- endif ()
273- endif ()
274-
275277if (PROXYRES_CURL AND (PROXYRES_EXECUTE OR PROXYRES_BUILD_CLI))
276278 if (NOT TARGET CURL::libcurl)
277279 include (FetchContent )
0 commit comments