File: meson.build

package info (click to toggle)
numpy 1%3A2.2.4%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 83,420 kB
  • sloc: python: 248,499; asm: 232,365; ansic: 216,874; cpp: 135,657; f90: 1,540; sh: 938; fortran: 558; makefile: 409; sed: 139; xml: 109; java: 92; perl: 79; cs: 54; javascript: 53; objc: 29; lex: 13; yacc: 9
file content (32 lines) | stat: -rw-r--r-- 1,542 bytes parent folder | download | duplicates (8)
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
# Primitive test for adding frameworks in XCode
# When opening the xcodeproj, the Folder "Frameworks" should contain two frameworks (OpenGL.framework and Foundation.framework)
# "Target Membership" of ...
# - OpenGL.framework should be only to prog@exe
# - Foundation.framework should be only to stat@sta
# "Build Phase" / "Link Binary with Libraries" for the target
# - "prog@exe" should be only "Foundation.framework"
# - "stat@sta" should be only "OpenGL.framework"
# see "xcode-frameworks.png" for an example

project('xcode framework test', 'objc', default_options : ['libdir=libtest'])

dep_main = dependency('appleframeworks', modules : ['Foundation'])

if meson.is_cross_build()
    # This is only available in iOS, not macOS. Just test finding it.
    uikit_dep = dependency('appleframeworks', modules: 'UIKit')
else
    dep_libs = dependency('appleframeworks', modules : ['OpenGL'], required : false)
    if not dep_libs.found()
      error('OpenGL framework not found')
    endif
    assert(dep_libs.type_name() == 'appleframeworks', 'type_name is wrong')
    # Only add the C compiler now, to ensure all lookups above were done with the ObjC one.
    add_languages('c')
    stlib = static_library('stat', 'stat.c', install : true, dependencies: dep_libs)
    exe = executable('prog', 'prog.c', install : true, dependencies: dep_main)
    uikit_dep = dependency('appleframeworks', modules: 'UIKit', required: false)
    if uikit_dep.found()
        error('UIKit found on macOS even though it should not be there.')
    endif
endif