| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/sysroot.gni") | 5 import("//build/config/sysroot.gni") |
| 6 import("//build/config/mac/mac_sdk.gni") | 6 import("//build/config/mac/mac_sdk.gni") |
| 7 | 7 |
| 8 config("sdk") { | 8 config("sdk") { |
| 9 common_flags = [ | 9 common_flags = [ |
| 10 "-isysroot", | 10 "-isysroot", |
| 11 sysroot, | 11 sysroot, |
| 12 "-mmacosx-version-min=$mac_deployment_target", | 12 "-mmacosx-version-min=$mac_deployment_target", |
| 13 ] | 13 ] |
| 14 | 14 |
| 15 cflags = common_flags | 15 cflags = common_flags |
| 16 ldflags = common_flags | 16 ldflags = common_flags |
| 17 } | 17 } |
| 18 | 18 |
| 19 # On Mac, this is used for everything except static libraries. | 19 # On Mac, this is used for everything except static libraries. |
| 20 config("mac_dynamic_flags") { | 20 config("mac_dynamic_flags") { |
| 21 ldflags = [ | 21 ldflags = [] |
| 22 "-Wl,-search_paths_first", | |
| 23 "-L.", | |
| 24 | 22 |
| 25 # Path for loading shared libraries for unbundled binaries. | 23 if (is_component_build) { |
| 26 "-Wl,-rpath,@loader_path/.", | 24 ldflags += [ |
| 25 # Path for loading shared libraries for unbundled binaries. |
| 26 "-Wl,-rpath,@loader_path/.", |
| 27 | 27 |
| 28 # Path for loading shared libraries for bundled binaries. Get back from | 28 # Path for loading shared libraries for bundled binaries. Get back from |
| 29 # Binary.app/Contents/MacOS. | 29 # Binary.app/Contents/MacOS. |
| 30 "-Wl,-rpath,@loader_path/../../..", | 30 "-Wl,-rpath,@loader_path/../../..", |
| 31 ] | 31 ] |
| 32 } |
| 32 } | 33 } |
| 33 | 34 |
| 34 # On Mac, this is used only for executables. | 35 # On Mac, this is used only for executables. |
| 35 config("mac_executable_flags") { | 36 config("mac_executable_flags") { |
| 37 # Remove this when targeting >=10.7 since it is the default in that config. |
| 36 ldflags = [ "-Wl,-pie" ] # Position independent. | 38 ldflags = [ "-Wl,-pie" ] # Position independent. |
| 37 } | 39 } |
| OLD | NEW |