Exemplo n.º 1
0
    def test_empty_package_lazily_bound(self):
        p = Package('p', [], [])
        p.lazily_bound = True

        out = StringIO()
        generate([p], out)

        commands = list(lex(out))

        apple_start, _ = find_command(commands, 'if', ['APPLE'])
        stmts = parse(iter(commands[apple_start:]))[0]

        _, props = find_command(stmts[1], 'set_target_properties')
        assert ([
            'p', 'PROPERTIES', 'LINK_FLAGS', '"-undefined', 'dynamic_lookup"'
        ] == props)
Exemplo n.º 2
0
    def test_empty_package_lazily_bound(self):
        p = Package('p', [], [])
        p.lazily_bound = True

        files = {}
        generate([p], get_filestore_writer(files))

        assert ('p.cmake' in files)
        commands = list(lex(files['p.cmake']))

        apple_start, _ = find_command(commands, 'if', ['APPLE'])
        stmts = parse(iter(commands[apple_start:]))[0]

        _, props = find_command(stmts[1], 'set_target_properties')
        assert ([
            'p', 'PROPERTIES', 'LINK_FLAGS', '"-undefined', 'dynamic_lookup"'
        ] == props)