Moved hashtabl and linkedlist into source.
This commit is contained in:
parent
856d47fec9
commit
b269abd0f7
|
@ -12,12 +12,7 @@ include(cmake/FindSDL2_mixer.cmake)
|
||||||
include(cmake/FindSDL2_ttf.cmake)
|
include(cmake/FindSDL2_ttf.cmake)
|
||||||
include(cmake/FindCheck.cmake)
|
include(cmake/FindCheck.cmake)
|
||||||
|
|
||||||
add_subdirectory(linkedlist)
|
|
||||||
add_subdirectory(hashtable)
|
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
linkedlist
|
|
||||||
hashtable
|
|
||||||
${LUA_INCLUDE_DIR}
|
${LUA_INCLUDE_DIR}
|
||||||
${SDL2_INCLUDE_DIR}
|
${SDL2_INCLUDE_DIR}
|
||||||
${SDL2_IMAGE_INCLUDE_DIR}
|
${SDL2_IMAGE_INCLUDE_DIR}
|
||||||
|
@ -47,11 +42,11 @@ add_executable(breakhack
|
||||||
src/stats
|
src/stats
|
||||||
src/actiontext
|
src/actiontext
|
||||||
src/random
|
src/random
|
||||||
|
src/linkedlist
|
||||||
|
src/hashtable
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(breakhack
|
target_link_libraries(breakhack
|
||||||
linkedlist
|
|
||||||
hashtable
|
|
||||||
${LUA_LIBRARY}
|
${LUA_LIBRARY}
|
||||||
${SDL2_LIBRARY}
|
${SDL2_LIBRARY}
|
||||||
${SDL2_IMAGE_LIBRARY}
|
${SDL2_IMAGE_LIBRARY}
|
||||||
|
@ -67,4 +62,12 @@ IF (CHECK_FOUND)
|
||||||
add_executable(test_util test/check_util src/util)
|
add_executable(test_util test/check_util src/util)
|
||||||
target_link_libraries(test_util ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(test_util ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
add_test(test_util test_util)
|
add_test(test_util test_util)
|
||||||
|
|
||||||
|
add_executable(test_linkedlist test/check_linkedlist src/linkedlist)
|
||||||
|
target_link_libraries(test_linkedlist ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
add_test(test_linkedlist test_linkedlist)
|
||||||
|
|
||||||
|
add_executable(test_hashtable test/check_hashtable src/hashtable)
|
||||||
|
target_link_libraries(test_hashtable ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
add_test(test_hashtable test_hashtable)
|
||||||
ENDIF (CHECK_FOUND)
|
ENDIF (CHECK_FOUND)
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
cmake_minimum_required (VERSION 3.2.0)
|
|
||||||
|
|
||||||
SET(CMAKE_COLOR_MAKEFILE ON)
|
|
||||||
|
|
||||||
include("../cmake/FindCheck.cmake")
|
|
||||||
|
|
||||||
project(hashtable C)
|
|
||||||
|
|
||||||
add_definitions("-Wall")
|
|
||||||
|
|
||||||
add_library(hashtable hashtable.c)
|
|
||||||
|
|
||||||
include_directories(${CHECK_INCLUDE_DIR})
|
|
||||||
|
|
||||||
if (CHECK_FOUND)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
enable_testing()
|
|
||||||
add_executable(test_table check_hashtable hashtable)
|
|
||||||
target_compile_options(test_table PRIVATE -pthread)
|
|
||||||
target_link_libraries(test_table ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
add_test(test_table test_table)
|
|
||||||
endif (CHECK_FOUND)
|
|
|
@ -1,22 +0,0 @@
|
||||||
cmake_minimum_required (VERSION 3.2.0)
|
|
||||||
|
|
||||||
SET(CMAKE_COLOR_MAKEFILE ON)
|
|
||||||
|
|
||||||
include("../cmake/FindCheck.cmake")
|
|
||||||
|
|
||||||
project(linkedlist C)
|
|
||||||
|
|
||||||
add_definitions("-Wall")
|
|
||||||
|
|
||||||
add_library(linkedlist linkedlist.c)
|
|
||||||
|
|
||||||
include_directories(${CHECK_INCLUDE_DIR})
|
|
||||||
|
|
||||||
if (CHECK_FOUND)
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
enable_testing()
|
|
||||||
add_executable(test_list check_linkedlist linkedlist)
|
|
||||||
target_compile_options(test_list PRIVATE -pthread)
|
|
||||||
target_link_libraries(test_list ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
add_test(test_list test_list)
|
|
||||||
endif (CHECK_FOUND)
|
|
|
@ -2,8 +2,8 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include <SDL2/SDL_image.h>
|
#include <SDL2/SDL_image.h>
|
||||||
#include <linkedlist.h>
|
|
||||||
|
|
||||||
|
#include "linkedlist.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "screenresolution.h"
|
#include "screenresolution.h"
|
||||||
#include "dimension.h"
|
#include "dimension.h"
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <linkedlist.h>
|
|
||||||
#include <hashtable.h>
|
|
||||||
|
|
||||||
|
#include "hashtable.h"
|
||||||
|
#include "linkedlist.h"
|
||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <check.h>
|
#include <check.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "hashtable.h"
|
#include "../src/hashtable.h"
|
||||||
|
|
||||||
START_TEST(test_hashtable_create)
|
START_TEST(test_hashtable_create)
|
||||||
{
|
{
|
|
@ -1,7 +1,7 @@
|
||||||
#include <check.h>
|
#include <check.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "linkedlist.h"
|
#include "../src/linkedlist.h"
|
||||||
|
|
||||||
START_TEST(test_linkedlist_create)
|
START_TEST(test_linkedlist_create)
|
||||||
{
|
{
|
Loading…
Reference in New Issue