INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-FILE(GLOB DAEMON_SRCS *.c *.cpp)
+IF(ENABLE_LOG_FEATURE)
+ ADD_DEFINITIONS("-DENABLE_EXTRA_LOCATION_DATA")
+ENDIF(ENABLE_LOG_FEATURE)
+
+SET(DAEMON_SRCS
+ phnd.c
+ phnd-dbus.c
+ phnd-region-data.c
+ phnd-utils.c
+ phnd-libphonenumber.cpp
+)
+
+IF(ENABLE_EXTRA_LOCATION_DATA)
+SET(DAEMON_SRCS ${DAEMON_SRCS}
+ phnd-location.c
+)
+ENDIF(ENABLE_EXTRA_LOCATION_DATA)
+
SET(DAEMON_SRCS ${DAEMON_SRCS} ${CMAKE_SOURCE_DIR}/common/phn-dbus.c)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/common/phn-dbus.c
#include "phnd.h"
#include "phnd-utils.h"
#include "phnd-libphonenumber.h"
+#ifdef ENABLE_EXTRA_LOCATION_DATA
#include "phnd-location.h"
+#endif
#include "phnd-region-data.h"
static inline int _dbus_get_location_handler(const char *number,
int ret;
char *lang_str = NULL;
char *region_str = NULL;
+#ifdef ENABLE_EXTRA_LOCATION_DATA
char *location_file = NULL;
+#endif
ret = phn_region_data_get_region_str(region, ®ion_str);
if (PHONE_NUMBER_ERROR_NONE != ret) {
return ret;
}
+#ifdef ENABLE_EXTRA_LOCATION_DATA
ret = phn_location_find_extra_data(region_str, &location_file);
if (PHONE_NUMBER_ERROR_NONE == ret) {
ret = phn_location_get_location_from_extra_data(location_file, number, region_str,
return PHONE_NUMBER_ERROR_NONE;
}
}
+#endif
bool exist = phn_region_data_find_match_info(region, lang);
if (false == exist) {