Skip to content
This repository was archived by the owner on Apr 13, 2019. It is now read-only.

Commit 9c11737

Browse files
author
Ramesh Ayyagari
committed
initial commit
1 parent d078dd5 commit 9c11737

File tree

4 files changed

+51
-25
lines changed

4 files changed

+51
-25
lines changed

CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@ include( CTest )
1717
include( version )
1818
include( detectCacheSize )
1919

20-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
20+
if(DEFINED ENV{ANDROID_API})
21+
message("... detected cross compile for $ENV{ANDROID_API_VERSION}")
22+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -D_ANDROID_ -D_$ENV{ANDROID_API_VERSION}_")
23+
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} $ENV{LDFLAGS}")
24+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} $ENV{LDFLAGS}")
25+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} $ENV{LDFLAGS}")
26+
else()
27+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
28+
endif()
29+
2130

2231
include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}/ccnx/forwarder/metis)
2332

ccnx/forwarder/metis/CMakeLists.txt

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -258,21 +258,30 @@ set(METIS_TLV_SOURCE
258258

259259
source_group(tlv FILES ${METIS_TLV_SOURCE})
260260

261-
if ( APPLE )
262-
set(METIS_PLATFORM_MODULES
263-
platforms/darwin/metis_GenericEther.c
264-
platforms/darwin/metis_System.c
265-
)
266-
source_group(platforms FILES ${METIS_PLATFORM_MODULES})
267-
endif()
268-
269-
if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
270-
set(METIS_PLATFORM_MODULES
271-
platforms/linux/metis_GenericEther.c
272-
platforms/linux/metis_System.c
273-
)
261+
if(DEFINED ENV{ANDROID_API})
262+
message("... detected cross compile for $ENV{ANDROID_API_VERSION} ignoring tests")
263+
set(METIS_PLATFORM_MODULES
264+
platforms/android/metis_GenericEther.c
265+
platforms/android/metis_System.c
266+
platforms/android/ifaddrs.c
267+
)
268+
source_group(platforms FILES ${METIS_PLATFORM_MODULES})
269+
else()
270+
if ( APPLE )
271+
set(METIS_PLATFORM_MODULES
272+
platforms/darwin/metis_GenericEther.c
273+
platforms/darwin/metis_System.c
274+
)
275+
source_group(platforms FILES ${METIS_PLATFORM_MODULES})
276+
endif()
277+
278+
if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
279+
set(METIS_PLATFORM_MODULES
280+
platforms/linux/metis_GenericEther.c
281+
platforms/linux/metis_System.c
282+
)
283+
endif()
274284
endif()
275-
276285
set(METIS_SOURCE_FILES
277286
metis_About.c
278287
${METIS_CONFIG_SOURCE}
@@ -297,13 +306,17 @@ foreach(lib ${metis_libraries})
297306
set_property(TARGET ${lib} PROPERTY C_STANDARD 99)
298307
endforeach()
299308

300-
add_subdirectory(test)
301-
add_subdirectory(command-line)
302-
add_subdirectory(tlv/test)
303-
add_subdirectory(strategies/test)
304-
add_subdirectory(processor/test)
305-
add_subdirectory(messenger/test)
306-
add_subdirectory(io/test)
307-
add_subdirectory(core/test)
308-
add_subdirectory(content_store/test)
309-
add_subdirectory(config/test)
309+
if(DEFINED ENV{ANDROID_API})
310+
message("... detected cross compile for $ENV{ANDROID_API_VERSION} ignoring tests")
311+
else()
312+
add_subdirectory(test)
313+
add_subdirectory(command-line)
314+
add_subdirectory(tlv/test)
315+
add_subdirectory(strategies/test)
316+
add_subdirectory(processor/test)
317+
add_subdirectory(messenger/test)
318+
add_subdirectory(io/test)
319+
add_subdirectory(core/test)
320+
add_subdirectory(content_store/test)
321+
add_subdirectory(config/test)
322+
endif()

ccnx/forwarder/metis/config/metis_CommandOps.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@
3939
#include <LongBow/runtime.h>
4040
#include <string.h>
4141

42+
#ifndef _ANDROID_
4243
#ifdef HAVE_ERRNO_H
4344
#include <errno.h>
4445
#else
4546
extern int errno;
4647
#endif
48+
#endif
4749

4850
#include <parc/algol/parc_Memory.h>
4951

ccnx/forwarder/metis/config/metis_CommandParser.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@
5050

5151
#include <ccnx/forwarder/metis/config/metis_CommandParser.h>
5252

53+
#ifndef _ANDROID_
5354
#ifdef HAVE_ERRNO_H
5455
#include <errno.h>
5556
#else
5657
extern int errno;
5758
#endif
59+
#endif
5860

5961
struct metis_command_parser {
6062
// key = command, value = MetisCommandOps

0 commit comments

Comments
 (0)