~raof/mir/prober-drm-device-probe

« back to all changes in this revision

Viewing changes to cmake/AndroidFlags.cmake

  • Committer: Kevin DuBois
  • Date: 2012-11-06 22:40:07 UTC
  • mto: This revision was merged to the branch mainline in revision 235.
  • Revision ID: kevin.dubois@canonical.com-20121106224007-x0o184wq2o6s1433
fix some cmake bugs. add file for android options

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function(get_android_flags)
 
2
  
 
3
  set(MIR_NDK_PATH $ENV{MIR_NDK_PATH})
 
4
  
 
5
  #build flags for finding things in the sysroot
 
6
  set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} --sysroot=${MIR_NDK_PATH}/sysroot")
 
7
  set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -isystem ${MIR_NDK_PATH}/sysroot/usr/include")
 
8
  set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -isystem ${MIR_NDK_PATH}/include/c++")
 
9
  set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -isystem ${MIR_NDK_PATH}/include/c++/arm-linux-androideabi/armv7-a")
 
10
 
 
11
  #note: this has to go away before landing. works around a STL header problem
 
12
  set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpermissive")
 
13
 
 
14
  set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS}" PARENT_SCOPE)
 
15
 
 
16
  #compile definitions
 
17
  set( ANDROID_DEFINITIONS 
 
18
    -D_GLIBCXX_HAS_GTHREADS;
 
19
    -D_GLIBCXX_USE_C99_STDINT_TR1;
 
20
    -DHAVE_ANDROID_OS=1;
 
21
    -D_GLIBCXX_USE_SCHED_YIELD;
 
22
    -DHAVE_FUTEX; 
 
23
    -DHAVE_FUTEX_WRAPPERS=1; 
 
24
    -DHAVE_FORKEXEC; 
 
25
    -DHAVE_OOM_ADJ; 
 
26
    -DHAVE_ANDROID_IPC; 
 
27
    -DHAVE_POSIX_FILEMAP; 
 
28
    -DHAVE_TERMIO_H; 
 
29
    -DHAVE_SYS_UIO_H; 
 
30
    -DHAVE_SYMLINKS; 
 
31
    -DHAVE_IOCTL; 
 
32
    -DHAVE_POSIX_CLOCKS; 
 
33
    -DHAVE_TIMEDWAIT_MONOTONIC; 
 
34
    -DHAVE_EPOLL; 
 
35
    -DHAVE_ENDIAN_H; 
 
36
    -DHAVE_LITTLE_ENDIAN; 
 
37
    -DHAVE_BACKTRACE=0; 
 
38
    -DHAVE_DLADDR=0; 
 
39
    -DHAVE_CXXABI=0; 
 
40
    -DHAVE_SCHED_SETSCHEDULER; 
 
41
    -D__linux__; 
 
42
    -DHAVE_MALLOC_H; 
 
43
    -DHAVE_LINUX_LOCAL_SOCKET_NAMESPACE=1; 
 
44
    -DHAVE_INOTIFY=1; 
 
45
    -DHAVE_MADVISE=1; 
 
46
    -DHAVE_TM_GMTOFF=1; 
 
47
    -DHAVE_DIRENT_D_TYPE=1; 
 
48
    -DARCH_ARM; 
 
49
    -DOS_SHARED_LIB_FORMAT_STR="lib%s.so"; 
 
50
    -DHAVE__MEMCMP16=1; 
 
51
    -DMINCORE_POINTER_TYPE="unsigned char *"; 
 
52
    -DHAVE_SA_NOCLDWAIT; 
 
53
    -DOS_PATH_SEPARATOR='/';
 
54
    -DOS_CASE_SENSITIVE; 
 
55
    -DHAVE_SYS_SOCKET_H=1; 
 
56
    -DHAVE_PRCTL=1; 
 
57
    -DHAVE_WRITEV=1 ;
 
58
    -DHAVE_STDINT_H=1 ;
 
59
    -DHAVE_STDBOOL_H=1 ;
 
60
    -DHAVE_SCHED_H=1 ;
 
61
    -D__STDC_INT64__;
 
62
    -DANDROID_SMP;
 
63
  
 
64
    -DANDROID;
 
65
    -DGTEST_OS_LINUX_ANDROID;
 
66
    -DGTEST_HAS_CLONE=0;
 
67
    -DGTEST_HAS_POSIX_RE=0
 
68
  
 
69
    PARENT_SCOPE
 
70
    )
 
71
 
 
72
  #linker flags
 
73
  set(ANDROID_LINKER_FLAGS "-Wl,-rpath,${MIR_NDK_PATH}/sysroot/usr/lib:${MIR_NDK_PATH}/arm-linux-androideabi/lib -lgnustl_shared" PARENT_SCOPE)
 
74
 
 
75
endfunction(get_android_flags)