Optimize build for example

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
This commit is contained in:
Jianhui Zhao committed 2018-01-05 21:46:03 +08:00
1 parent c38a36ec19
commit c9252d78e4
7 files changed
+19 -43

No files matched your search

+2 -15
View File
@@ -1,17 +1,4 @@
cmake_minimum_required(VERSION 2.8)
project(libuhttpd-example C)
#set(CMAKE_VERBOSE_MAKEFILE ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake/Modules/")
add_definitions(-O -Wall -Werror --std=gnu99 -D_GNU_SOURCE -Wno-misleading-indentation)
find_package(Libuhttpd REQUIRED)
find_package(Libubox REQUIRED)
include_directories(${LIBUHTTPD_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src)
add_executable(helloworld helloworld.c)
target_link_libraries(helloworld ${LIBUHTTPD_LIBRARY} ${LIBUBOX_LIBRARY})
target_link_libraries(helloworld uhttpd ${LIBUBOX_LIBRARY})
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
openssl req -x509 -newkey rsa:2048 -nodes -keyout server-key.pem -out server-cert.pem -config openssl.cnf
+5 -1
View File
@@ -15,7 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <uhttpd/uhttpd.h>
#include <uhttpd.h>
//#define EXAMPLE_SSL
#define port "8000"
@@ -51,9 +53,11 @@ int main(int argc, char **argv)
uh_log_debug("Listen on: *:%s", port);
#ifdef EXAMPLE_SSL
#if (UHTTPD_SSL_SUPPORT)
if (srv->ssl_init(srv, "/etc/wifidog/wifidog.key", "/etc/wifidog/wifidog.crt") < 0)
goto done;
#endif
#endif
srv->add_action(srv, "/hello", hello_action);
-5
View File
@@ -1,5 +0,0 @@
[ req ]
distinguished_name = req_distinguished_name
prompt = no
[ req_distinguished_name ]
CN = DONT USE - test cert for libuhttp