From 5cba331ad3c2e8eb429b8e5d4a9db745c1a743ea Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 3 Jun 2012 12:51:35 -0700 Subject: [PATCH] cmake files for uil and kernel fixing a bunch of files that do not compile on their own --- src/CMakeLists.txt | 1 + src/kernel/CMakeLists.txt | 71 +++++++++++++++++++++++++++++++++++++++ src/kernel/equipment.c | 2 +- src/kernel/item.c | 1 + src/kernel/magic.h | 5 --- src/kernel/pool_test.c | 2 ++ src/kernel/types.h | 2 ++ src/kernel/unit.c | 4 ++- 8 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 src/kernel/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e74bd8a92..7ee7758de 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -7,3 +7,4 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../cmake/Modu add_subdirectory (../../dependencies "${CMAKE_CURRENT_BINARY_DIR}/dependencies") add_subdirectory (util) +add_subdirectory (kernel) diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt new file mode 100644 index 000000000..d02f7dddc --- /dev/null +++ b/src/kernel/CMakeLists.txt @@ -0,0 +1,71 @@ +cmake_minimum_required (VERSION 2.4) +project (kernel) + +#find_package (Lua51 REQUIRED) +#find_package (LibXml2 REQUIRED) +#find_package (CuTest REQUIRED HINTS ${DEPENDENCIES_DIR}) +#find_package (QuickList REQUIRED) +#find_package (CritBit REQUIRED) + +include_directories (..) +#include_directories (${LUA_INCLUDE_DIR}) +include_directories (${LIBXML2_INCLUDE_DIR}) +include_directories (${CRITBIT_INCLUDE_DIR}) +include_directories (${QUICKLIST_INCLUDE_DIR}) +include_directories (${CUTEST_INCLUDE_DIR}) +include_directories (${INIPARSER_INCLUDE_DIR}) +include_directories (${CRYPTO_INCLUDE_DIR}) + +add_library (kernel + alchemy.c + alliance.c + battle.c + battle_test.c + binarystore.c + build.c + building.c + building_test.c + calendar.c + command.c + config.c + connection.c + curse.c + curse_test.c + equipment.c + equipment_test.c + faction.c + group.c + item.c + item_test.c + magic.c + magic_test.c + message.c + move.c + move_test.c + names.c + order.c + pathfinder.c + plane.c + player.c + pool.c + pool_test.c + race.c + region.c + reports.c + reports_test.c + resources.c + save.c + ship.c + ship_test.c + skill.c + spellbook.c + spellbook_test.c + spell.c + spell_test.c + sqlite.c + teleport.c + terrain.c + textstore.c + unit.c + xmlreader.c +) diff --git a/src/kernel/equipment.c b/src/kernel/equipment.c index 956cc0626..42c505499 100644 --- a/src/kernel/equipment.c +++ b/src/kernel/equipment.c @@ -83,7 +83,7 @@ void equipment_setskill(equipment * eq, skill_t sk, const char *value) } } -void equipment_addspell(equipment * eq, spell * sp, int level) +void equipment_addspell(equipment * eq, struct spell * sp, int level) { if (eq) { if (!eq->spellbook) { diff --git a/src/kernel/item.c b/src/kernel/item.c index 35d8451a0..c588fbeca 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -24,6 +24,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "alchemy.h" #include "build.h" +#include "curse.h" #include "faction.h" #include "message.h" #include "pool.h" diff --git a/src/kernel/magic.h b/src/kernel/magic.h index f896be52d..07ec04772 100644 --- a/src/kernel/magic.h +++ b/src/kernel/magic.h @@ -22,11 +22,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. extern "C" { #endif -#include "curse.h" - struct fighter; - struct building; - struct spellbook; - /* ------------------------------------------------------------- */ #define MAXCOMBATSPELLS 3 /* PRECOMBAT COMBAT POSTCOMBAT */ diff --git a/src/kernel/pool_test.c b/src/kernel/pool_test.c index 5e521cff5..38be7aaae 100644 --- a/src/kernel/pool_test.c +++ b/src/kernel/pool_test.c @@ -1,9 +1,11 @@ #include +#include #include "pool.h" #include "unit.h" #include "item.h" #include "region.h" +#include "skill.h" #include #include diff --git a/src/kernel/types.h b/src/kernel/types.h index ef5ee6013..23cef5f51 100644 --- a/src/kernel/types.h +++ b/src/kernel/types.h @@ -38,6 +38,7 @@ struct attrib_type; struct building; struct building_type; struct curse; +struct curse_type; struct equipment; struct faction; struct fighter; @@ -48,6 +49,7 @@ struct luxury_type; struct order; struct plane; struct potion_type; +struct quicklist; struct race; struct region; struct region_list; diff --git a/src/kernel/unit.c b/src/kernel/unit.c index 585696e3f..c24902076 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -18,12 +18,14 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#include #include "unit.h" #include "building.h" #include "faction.h" #include "group.h" #include "connection.h" +#include "curse.h" #include "item.h" #include "move.h" #include "order.h" @@ -1757,4 +1759,4 @@ struct spellbook * unit_get_spellbook(const struct unit * u) } } return 0; -} \ No newline at end of file +}