Skip to content

Commit

Permalink
tweaked
Browse files Browse the repository at this point in the history
  • Loading branch information
kajisha committed Jul 13, 2015
1 parent f42272e commit 9185431
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CMakeFiles
cmake_install.cmake
Makefile
bin
libezhttpd.a
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 -Wall -g")

add_subdirectory(src)
add_subdirectory(test)

add_executable(server src/main.c)
target_link_libraries(server ezhttpd)
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
file(GLOB SOURCES *.c)
add_executable(server ${SOURCES})
add_library(ezhttpd STATIC tcp_server.c http_server.c)

target_include_directories(ezhttpd PUBLIC "$<BUILD_INTERFACE:${ROOT_SOURCE_DIR}/src>")
Empty file added test/.gitkeep
Empty file.
10 changes: 10 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file(GLOB SOURCES *.c)

enable_testing()

add_executable(test_server ${SOURCES})
target_link_libraries(test_server ezhttpd)

set_target_properties(test_server PROPERTIES LINK_FLAGS -Wl,-lcunit)

add_test(test_server ${EXECUTABLE_OUTOUT_PATH}/test_server)

0 comments on commit 9185431

Please sign in to comment.