summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-20 16:59:07 +0000
committerflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-03-20 16:59:07 +0000
commitee36fd725c890c5156f1d777368eeb84d5a3922e (patch)
treebdbec3c90830fa82e78774f62032896de7a2ba1a /src
parent78fe9886d39b11a38903ffc513a70fa2b00e43f3 (diff)
downloadhercules-ee36fd725c890c5156f1d777368eeb84d5a3922e.tar.gz
hercules-ee36fd725c890c5156f1d777368eeb84d5a3922e.tar.bz2
hercules-ee36fd725c890c5156f1d777368eeb84d5a3922e.tar.xz
hercules-ee36fd725c890c5156f1d777368eeb84d5a3922e.zip
- Fixed CMake compilation (libconfig integrated into common_base).
- Chanced libconfig.h include directives to double-quoted form (never use the system version of libconfig.h). - Removed ShowError/ShowNotice from sig plugin (showmsg.c depends on core.c). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15737 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char/CMakeLists.txt4
-rw-r--r--src/common/CMakeLists.txt17
-rw-r--r--src/common/conf.c2
-rw-r--r--src/common/conf.h2
-rw-r--r--src/common/showmsg.h2
-rw-r--r--src/login/sql/CMakeLists.txt4
-rw-r--r--src/map/sql/CMakeLists.txt6
-rw-r--r--src/plugins/CMakeLists.txt8
-rw-r--r--src/plugins/sig.c9
-rw-r--r--src/tool/CMakeLists.txt2
10 files changed, 30 insertions, 26 deletions
diff --git a/src/char/CMakeLists.txt b/src/char/CMakeLists.txt
index ccb718141..7f8cf2cc7 100644
--- a/src/char/CMakeLists.txt
+++ b/src/char/CMakeLists.txt
@@ -38,8 +38,8 @@ set( SQL_CHAR_SOURCES
)
set( DEPENDENCIES common_sql )
set( LIBRARIES ${GLOBAL_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${LIBCONFIG_INCLUDE_DIRS} )
-set( DEFINITIONS "${GLOBAL_DEFINITIONS}" )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${COMMON_BASE_INCLUDE_DIRS} )
+set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_BASE_DEFINITIONS}" )
set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ${SQL_CHAR_HEADERS} ${SQL_CHAR_SOURCES} )
source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} )
source_group( char FILES ${SQL_CHAR_HEADERS} ${SQL_CHAR_SOURCES} )
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index f7acda740..effd0b2ab 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -40,14 +40,17 @@ set( COMMON_MINI_HEADERS
"${COMMON_SOURCE_DIR}/malloc.h"
"${COMMON_SOURCE_DIR}/showmsg.h"
"${COMMON_SOURCE_DIR}/strlib.h"
+ ${LIBCONFIG_HEADERS} # needed by showmsg.h
CACHE INTERNAL "" )
set( COMMON_MINI_SOURCES
"${COMMON_SOURCE_DIR}/core.c"
"${COMMON_SOURCE_DIR}/malloc.c"
"${COMMON_SOURCE_DIR}/showmsg.c"
"${COMMON_SOURCE_DIR}/strlib.c"
+ ${LIBCONFIG_SOURCES} # needed by showmsg.c
CACHE INTERNAL "" )
-set( COMMON_MINI_DEFINITIONS "-DMINICORE" CACHE INTERNAL "" )
+set( COMMON_MINI_INCLUDE_DIRS ${LIBCONFIG_INCLUDE_DIRS} CACHE INTERNAL "" )
+set( COMMON_MINI_DEFINITIONS "-DMINICORE ${LIBCONFIG_DEFINITIONS}" CACHE INTERNAL "" )
#
@@ -75,6 +78,7 @@ set( COMMON_BASE_HEADERS
"${COMMON_SOURCE_DIR}/strlib.h"
"${COMMON_SOURCE_DIR}/timer.h"
"${COMMON_SOURCE_DIR}/utils.h"
+ ${LIBCONFIG_HEADERS} # needed by conf.h/showmsg.h
CACHE INTERNAL "common_base headers" )
set( COMMON_BASE_SOURCES
"${COMMON_SOURCE_DIR}/conf.c"
@@ -95,10 +99,17 @@ set( COMMON_BASE_SOURCES
"${COMMON_SOURCE_DIR}/strlib.c"
"${COMMON_SOURCE_DIR}/timer.c"
"${COMMON_SOURCE_DIR}/utils.c"
+ ${LIBCONFIG_SOURCES} # needed by conf.c/showmsg.c
CACHE INTERNAL "common_base sources" )
+set( COMMON_BASE_INCLUDE_DIRS
+ ${LIBCONFIG_INCLUDE_DIRS}
+ CACHE INTERNAL "common_base include dirs" )
+set( COMMON_BASE_DEFINITIONS
+ ${LIBCONFIG_DEFINITIONS}
+ CACHE INTERNAL "common_base definitions" )
set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${LIBCONFIG_INCLUDE_DIRS} )
-set( DEFINITIONS "${GLOBAL_DEFINITIONS}" )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${MT19937AR_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${COMMON_BASE_INCLUDE_DIRS} )
+set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_BASE_DEFINITIONS}" )
set( SOURCE_FILES ${MT19937AR_HEADERS} ${MT19937AR_SOURCES} ${COMMON_BASE_HEADERS} ${COMMON_BASE_SOURCES} )
source_group( mt19937ar FILES ${MT19937AR_HEADERS} ${MT19937AR_SOURCES} )
source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_BASE_SOURCES} )
diff --git a/src/common/conf.c b/src/common/conf.c
index eed39d409..a5bfec159 100644
--- a/src/common/conf.c
+++ b/src/common/conf.c
@@ -2,7 +2,7 @@
// For more information, see LICENCE in the main folder
#include "conf.h"
-#include <libconfig.h>
+#include "libconfig.h"
#include "../common/showmsg.h" // ShowError
diff --git a/src/common/conf.h b/src/common/conf.h
index 0b70a0c79..4c3dec89f 100644
--- a/src/common/conf.h
+++ b/src/common/conf.h
@@ -5,7 +5,7 @@
#define _CONF_H_
#include "../common/cbasetypes.h"
-#include <libconfig.h>
+#include "libconfig.h"
int conf_read_file(config_t *config, const char *config_filename);
int config_setting_copy(config_setting_t *parent, const config_setting_t *src);
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 839f1dc7e..302ba5cd0 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -4,7 +4,7 @@
#ifndef _SHOWMSG_H_
#define _SHOWMSG_H_
-#include <libconfig.h>
+#include "libconfig.h"
// for help with the console colors look here:
// http://www.edoceo.com/liberum/?doc=printf-with-color
diff --git a/src/login/sql/CMakeLists.txt b/src/login/sql/CMakeLists.txt
index f1f7c7f23..1355f17ee 100644
--- a/src/login/sql/CMakeLists.txt
+++ b/src/login/sql/CMakeLists.txt
@@ -18,8 +18,8 @@ set( SQL_LOGIN_SOURCES
)
set( DEPENDENCIES common_sql )
set( LIBRARIES ${GLOBAL_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${LIBCONFIG_INCLUDE_DIRS} )
-set( DEFINITIONS "${GLOBAL_DEFINITIONS} -DWITH_SQL" )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${COMMON_BASE_INCLUDE_DIRS} )
+set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_BASE_DEFINITIONS} -DWITH_SQL" )
set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ${SQL_LOGIN_HEADERS} ${SQL_LOGIN_SOURCES} )
source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} )
source_group( login FILES ${SQL_LOGIN_HEADERS} ${SQL_LOGIN_SOURCES} )
diff --git a/src/map/sql/CMakeLists.txt b/src/map/sql/CMakeLists.txt
index 20383e320..0d33cb419 100644
--- a/src/map/sql/CMakeLists.txt
+++ b/src/map/sql/CMakeLists.txt
@@ -81,8 +81,8 @@ set( SQL_MAP_SOURCES
)
set( DEPENDENCIES common_sql )
set( LIBRARIES ${GLOBAL_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${LIBCONFIG_INCLUDE_DIRS} )
-set( DEFINITIONS "${GLOBAL_DEFINITIONS}" )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${COMMON_BASE_INCLUDE_DIRS} )
+set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_BASE_DEFINITIONS}" )
if( WITH_PCRE )
message( STATUS "Enabled PCRE code" )
set( LIBRARIES ${LIBRARIES} ${PCRE_LIBRARIES} )
@@ -91,7 +91,7 @@ if( WITH_PCRE )
else()
message( STATUS "Disabled PCRE code" )
endif()
-set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ${SQL_MAP_HEADERS} ${SQL_MAP_SOURCES} ${LIBCONFIG_HEADERS} ${LIBCONFIG_SOURCES} )
+set( SOURCE_FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} ${SQL_MAP_HEADERS} ${SQL_MAP_SOURCES} )
source_group( common FILES ${COMMON_BASE_HEADERS} ${COMMON_SQL_HEADERS} )
source_group( map FILES ${SQL_MAP_HEADERS} ${SQL_MAP_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 903a1ec6e..21ffc3994 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -151,17 +151,11 @@ option( BUILD_PLUGIN_sig "build sig plugin" OFF )
if( BUILD_PLUGIN_sig )
message( STATUS "Creating target sig" )
set( SIG_SOURCES
- "${COMMON_SOURCE_DIR}/malloc.c"
- "${COMMON_SOURCE_DIR}/malloc.h"
- "${COMMON_SOURCE_DIR}/showmsg.c"
- "${COMMON_SOURCE_DIR}/showmsg.h"
- "${COMMON_SOURCE_DIR}/strlib.c"
- "${COMMON_SOURCE_DIR}/strlib.h"
"${CMAKE_CURRENT_SOURCE_DIR}/sig.c"
)
set( LIBRARIES ${GLOBAL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
-set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_MINI_DEFINITIONS} -DNO_MEMMGR" )
+set( DEFINITIONS "${GLOBAL_DEFINITIONS} -DNO_MEMMGR" )
set( SOURCE_FILES ${SIG_SOURCES} )
source_group( sig FILES ${SIG_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
diff --git a/src/plugins/sig.c b/src/plugins/sig.c
index 8f7dead4b..04d07a496 100644
--- a/src/plugins/sig.c
+++ b/src/plugins/sig.c
@@ -7,7 +7,6 @@
#include <string.h>
#include <time.h>
#include "../common/plugin.h"
-#include "../common/showmsg.h"
PLUGIN_INFO = {
"Signals",
@@ -28,14 +27,14 @@ PLUGIN_EVENTS_TABLE = {
#if defined(_WIN32) || defined(MINGW)
int sig_init()
{
- ShowError("sig: This plugin is not supported - Enable 'exchndl' instead!\n");
+ printf("sig: This plugin is not supported - Enable 'exchndl' instead!\n");
return 0;
}
int sig_final() { return 0; }
#elif defined (__NETBSD__) || defined (__FREEBSD__)
int sig_init()
{
- ShowError("sig: This plugin is not supported!\n");
+ printf("sig: This plugin is not supported!\n");
return 0;
}
int sig_final() { return 0; }
@@ -117,7 +116,7 @@ void sig_dump(int sn)
size_t size;
#endif
- ShowNotice ("Dumping stack to '"CL_WHITE"%s"CL_RESET"'...\n", file);
+ printf ("sig: Dumping stack to '%s'...\n", file);
if ((revision = getrevision()) != NULL)
fprintf(fp, "Version: svn%s \n", revision);
fprintf(fp, "Exception: %s \n", strsignal(sn));
@@ -136,7 +135,7 @@ void sig_dump(int sn)
free(stack);
#endif
- ShowNotice("%s Saved.\n", file);
+ printf("sig: %s Saved.\n", file);
fflush(stdout);
fclose(fp);
}
diff --git a/src/tool/CMakeLists.txt b/src/tool/CMakeLists.txt
index 76840a367..a54ffa0e2 100644
--- a/src/tool/CMakeLists.txt
+++ b/src/tool/CMakeLists.txt
@@ -25,7 +25,7 @@ set( MAPCACHE_SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/mapcache.c"
)
set( LIBRARIES ${GLOBAL_LIBRARIES} ${ZLIB_LIBRARIES} )
-set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${LIBCONFIG_INCLUDE_DIRS} )
+set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${COMMON_MINI_INCLUDE_DIRS} )
set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_MINI_DEFINITIONS}" )
set( SOURCE_FILES ${COMMON_HEADERS} ${COMMON_SOURCES} ${MAPCACHE_SOURCES} )
source_group( common FILES ${COMMON_HEADERS} ${COMMON_SOURCES} )