summaryrefslogtreecommitdiff
path: root/platform/ios/config.cmake
blob: e5386e4ae088667e1958709ead324416f4946f1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
set(USE_GLES2 ON)

macro(initialize_ios_target target)
    set_xcode_property(${target} IPHONEOS_DEPLOYMENT_TARGET "9.0")
    set_xcode_property(${target} ENABLE_BITCODE "YES")
    set_xcode_property(${target} BITCODE_GENERATION_MODE bitcode)
    set_xcode_property(${target} ONLY_ACTIVE_ARCH $<$<CONFIG:Debug>:YES>)

    target_compile_options(${target}
        PRIVATE -fobjc-arc
    )
endmacro()


include(cmake/loop-darwin.cmake)
initialize_ios_target(icu)
initialize_ios_target(mbgl-loop-darwin)


macro(mbgl_platform_core)
    initialize_ios_target(mbgl-core)

    target_sources_from_file(mbgl-core PRIVATE platform/ios/core-files.json)

    target_include_directories(mbgl-core
        PUBLIC platform/darwin/include
        PUBLIC platform/default/include
    )

    target_link_libraries(mbgl-core
        PUBLIC "-lz"
        PUBLIC "-framework Foundation"
        PUBLIC "-framework CoreText"
        PUBLIC "-framework CoreGraphics"
        PUBLIC "-framework OpenGLES"
        PUBLIC "-framework ImageIO"
        PUBLIC "-framework MobileCoreServices"
        PUBLIC "-framework SystemConfiguration"
    )
endmacro()


macro(mbgl_filesource)
    initialize_ios_target(mbgl-filesource)

    # Modify platform/darwin/filesource-files.json to change the source files for this target.
    target_sources_from_file(mbgl-filesource PRIVATE platform/darwin/filesource-files.json)

    target_link_libraries(mbgl-filesource
        PUBLIC "-lsqlite3"
        PUBLIC "-framework Foundation"
    )
endmacro()