summaryrefslogtreecommitdiffstats
path: root/build/config/mac/BUILD.gn
blob: 2ebf45872d12447d35f9e245412db782a89da8ae (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
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/sysroot.gni")

config("sdk") {
  common_flags = [
    "-isysroot", sysroot,
    "-mmacosx-version-min=10.6"
  ]

  cflags = common_flags
  ldflags = common_flags
}

# On Mac, this is used for everything except static libraries.
config("mac_dynamic_flags") {
  ldflags = [
    "-Wl,-search_paths_first",
    "-L.",
    # Path for loading shared libraries for unbundled binaries.
    "-Wl,-rpath,@loader_path/.",
    # Path for loading shared libraries for bundled binaries. Get back from
    # Binary.app/Contents/MacOS.
    "-Wl,-rpath,@loader_path/../../..",
  ]
}

# On Mac, this is used only for executables.
config("mac_executable_flags") {
  ldflags = [
    "-Wl,-pie",  # Position independent.
  ]
}