summaryrefslogtreecommitdiff
path: root/tests/projects/objc/iosapp_framework_rpath/test.lua
blob: efc69dbeadd912bf8c313f3d27216e57a47c0bfb (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
import("utils.binary.rpath")

function main(t)
    if not is_host("macosx") then
        return t:skip("wrong host platform")
    end

    os.execv("xmake", {"f", "-p", "iphoneos", "-a", "arm64", "--appledev=simulator", "-c"})
    os.execv("xmake", {"-vD"})
    local appfile = "build/iphoneos/arm64/release/demo.app/demo"
    local rpaths = rpath.list(appfile)
    local found_ios = false
    local found_macos = false
    if rpaths then
        for _, p in ipairs(rpaths) do
            if p == "@executable_path/Frameworks" then
                found_ios = true
            end
            if p == "@executable_path/../Frameworks" then
                found_macos = true
            end
        end
    end
    if not found_ios then
        raise("missing iOS framework rpath @executable_path/Frameworks")
    end
    if found_macos then
        raise("found macOS-style framework rpath in iOS app")
    end
end