-
Notifications
You must be signed in to change notification settings - Fork 3
cmake: improve: configure proxyres_config.h for preprocessor conditions #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,8 @@ set(PROXYRES_HDRS | |
| include/proxyres/config.h | ||
| include/proxyres/log.h | ||
| include/proxyres/proxyres.h | ||
| include/proxyres/resolver.h) | ||
| include/proxyres/resolver.h | ||
| ${PROJECT_BINARY_DIR}/proxyres_config.h) | ||
| if(PROXYRES_EXECUTE) | ||
| list(APPEND PROXYRES_HDRS | ||
| include/proxyres/execute.h) | ||
|
|
@@ -254,24 +255,25 @@ if(PROXYRES_USE_CXX) | |
| endif() | ||
| endif() | ||
|
|
||
| if(NOT WIN32) | ||
| check_include_file("net/if_arp.h" HAVE_NET_IF_ARP_H) | ||
| check_include_file("netdb.h" HAVE_NETDB_H) | ||
|
sergio-nsk marked this conversation as resolved.
|
||
| endif() | ||
|
|
||
| configure_file(proxyres_config.h.in proxyres_config.h @ONLY NEWLINE_STYLE UNIX) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is roxyres_config.h.in defined?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. proxyres_config.h.in - is a new file in the commit.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think about the name
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other projects use such template
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm I wonder about this now that I approved it, because
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I don't suggest it, and |
||
|
|
||
| add_library(proxyres ${PROXYRES_HDRS} ${PROXYRES_SRCS} ${PROXYRES_C_SRCS}) | ||
| set_property(TARGET proxyres PROPERTY C_STANDARD 11 CXX_STANDARD 11) | ||
| if(PROXYRES_BUILD_TESTS) | ||
| target_compile_definitions(proxyres PRIVATE PROXYRES_TESTING) | ||
| endif() | ||
| target_include_directories(proxyres PRIVATE | ||
| ${CMAKE_CURRENT_SOURCE_DIR} | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/include/proxyres) | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/include/proxyres | ||
| ${PROJECT_BINARY_DIR}) | ||
| target_include_directories(proxyres PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>) | ||
|
|
||
| if(NOT WIN32) | ||
| check_include_file("net/if_arp.h" HAVE_NET_IF_ARP_H) | ||
| if(HAVE_NET_IF_ARP_H) | ||
| target_compile_definitions(proxyres PRIVATE HAVE_NET_IF_ARP_H) | ||
| endif() | ||
| endif() | ||
|
|
||
| if(PROXYRES_CURL AND (PROXYRES_EXECUTE OR PROXYRES_BUILD_CLI)) | ||
| if(NOT TARGET CURL::libcurl) | ||
| include(FetchContent) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| #include "proxyres_config.h" | ||
|
|
||
| #include <stdint.h> | ||
| #include <stdbool.h> | ||
| #include <stdlib.h> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // Define to 1 if you have the <net/if_arp.h> header file. | ||
| #cmakedefine HAVE_NET_IF_ARP_H 1 | ||
|
|
||
| // Define to 1 if you have the <netdb.h> header file. | ||
| #cmakedefine HAVE_NETDB_H 1 | ||
|
sergio-nsk marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.