Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. 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 """ | 5 """ |
| 6 This module contains classes that help to emulate xcodebuild behavior on top of | 6 This module contains classes that help to emulate xcodebuild behavior on top of |
| 7 other build systems, such as make and ninja. | 7 other build systems, such as make and ninja. |
| 8 """ | 8 """ |
| 9 | 9 |
| 10 import gyp.common | 10 import gyp.common |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 | 270 |
| 271 if self._Test('GCC_TREAT_WARNINGS_AS_ERRORS', 'YES', default='NO'): | 271 if self._Test('GCC_TREAT_WARNINGS_AS_ERRORS', 'YES', default='NO'): |
| 272 cflags.append('-Werror') | 272 cflags.append('-Werror') |
| 273 | 273 |
| 274 if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'): | 274 if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'): |
| 275 cflags.append('-Wnewline-eof') | 275 cflags.append('-Wnewline-eof') |
| 276 | 276 |
| 277 self._Appendf(cflags, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s') | 277 self._Appendf(cflags, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s') |
| 278 | 278 |
| 279 # TODO: | 279 # TODO: |
| 280 self._WarnUnimplemented('ARCHS') | |
| 281 if self._Test('COPY_PHASE_STRIP', 'YES', default='NO'): | 280 if self._Test('COPY_PHASE_STRIP', 'YES', default='NO'): |
| 282 self._WarnUnimplemented('COPY_PHASE_STRIP') | 281 self._WarnUnimplemented('COPY_PHASE_STRIP') |
| 283 self._WarnUnimplemented('GCC_DEBUGGING_SYMBOLS') | 282 self._WarnUnimplemented('GCC_DEBUGGING_SYMBOLS') |
| 284 self._WarnUnimplemented('GCC_ENABLE_OBJC_EXCEPTIONS') | 283 self._WarnUnimplemented('GCC_ENABLE_OBJC_EXCEPTIONS') |
| 285 self._WarnUnimplemented('GCC_ENABLE_OBJC_GC') | 284 self._WarnUnimplemented('GCC_ENABLE_OBJC_GC') |
| 286 | 285 |
| 287 # TODO: This is exported correctly, but assigning to it is not supported. | 286 # TODO: This is exported correctly, but assigning to it is not supported. |
| 288 self._WarnUnimplemented('MACH_O_TYPE') | 287 self._WarnUnimplemented('MACH_O_TYPE') |
| 289 self._WarnUnimplemented('PRODUCT_TYPE') | 288 self._WarnUnimplemented('PRODUCT_TYPE') |
| 290 | 289 |
| 291 # TODO: Do not hardcode arch. Supporting fat binaries will be annoying. | 290 archs = self._Settings().get('ARCHS', ['i386']) |
| 292 # Even if self._Settings()['ARCHS'] contains only a single arch, dependent | 291 if len(archs) == 1: |
| 293 # targets might have been built with a different single arch. | 292 cflags.append('-arch ' + archs[0]) |
| 294 cflags.append('-arch i386') | 293 else: |
| 294 # TODO: Supporting fat binaries will be annoying. | |
| 295 self._WarnUnimplemented('ARCHS') | |
| 296 cflags.append('-arch i386') | |
|
Nico
2012/02/14 01:16:43
nit: It's a little shorter if written like
if len
ukai
2012/02/14 06:09:33
Done.
| |
| 295 | 297 |
| 296 cflags += self._Settings().get('OTHER_CFLAGS', []) | 298 cflags += self._Settings().get('OTHER_CFLAGS', []) |
| 297 cflags += self._Settings().get('WARNING_CFLAGS', []) | 299 cflags += self._Settings().get('WARNING_CFLAGS', []) |
| 298 | 300 |
| 299 config = self.spec['configurations'][self.configname] | 301 config = self.spec['configurations'][self.configname] |
| 300 framework_dirs = config.get('mac_framework_dirs', []) | 302 framework_dirs = config.get('mac_framework_dirs', []) |
| 301 for directory in framework_dirs: | 303 for directory in framework_dirs: |
| 302 cflags.append('-F ' + directory.replace('$(SDKROOT)', sdk_root)) | 304 cflags.append('-F ' + directory.replace('$(SDKROOT)', sdk_root)) |
| 303 | 305 |
| 304 self.configname = None | 306 self.configname = None |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 ldflags.append('-isysroot ' + self._SdkPath()) | 388 ldflags.append('-isysroot ' + self._SdkPath()) |
| 387 | 389 |
| 388 for library_path in self._Settings().get('LIBRARY_SEARCH_PATHS', []): | 390 for library_path in self._Settings().get('LIBRARY_SEARCH_PATHS', []): |
| 389 ldflags.append('-L' + gyp_to_build_path(library_path)) | 391 ldflags.append('-L' + gyp_to_build_path(library_path)) |
| 390 | 392 |
| 391 if 'ORDER_FILE' in self._Settings(): | 393 if 'ORDER_FILE' in self._Settings(): |
| 392 ldflags.append('-Wl,-order_file ' + | 394 ldflags.append('-Wl,-order_file ' + |
| 393 '-Wl,' + gyp_to_build_path( | 395 '-Wl,' + gyp_to_build_path( |
| 394 self._Settings()['ORDER_FILE'])) | 396 self._Settings()['ORDER_FILE'])) |
| 395 | 397 |
| 396 # TODO: Do not hardcode arch. Supporting fat binaries will be annoying. | 398 archs = self._Settings().get('ARCHS', ['i386']) |
| 397 ldflags.append('-arch i386') | 399 if len(archs) == 1: |
| 400 ldflags.append('-arch ' + archs[0]) | |
| 401 else: | |
| 402 # TODO: Supporting fat binaries will be annoying. | |
| 403 self._WarnUnimplemented('ARCHS') | |
| 404 ldflags.append('-arch i386') | |
| 398 | 405 |
| 399 # Xcode adds the product directory by default. | 406 # Xcode adds the product directory by default. |
| 400 ldflags.append('-L' + product_dir) | 407 ldflags.append('-L' + product_dir) |
| 401 | 408 |
| 402 install_name = self.GetPerTargetSetting('LD_DYLIB_INSTALL_NAME') | 409 install_name = self.GetPerTargetSetting('LD_DYLIB_INSTALL_NAME') |
| 403 install_base = self.GetPerTargetSetting('DYLIB_INSTALL_NAME_BASE') | 410 install_base = self.GetPerTargetSetting('DYLIB_INSTALL_NAME_BASE') |
| 404 default_install_name = \ | 411 default_install_name = \ |
| 405 '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)' | 412 '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)' |
| 406 if not install_name and install_base: | 413 if not install_name and install_base: |
| 407 install_name = default_install_name | 414 install_name = default_install_name |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 947 # absolutified. Else, it's in the PATH (e.g. install_name_tool, ln). | 954 # absolutified. Else, it's in the PATH (e.g. install_name_tool, ln). |
| 948 if os.path.sep in shell_list[0]: | 955 if os.path.sep in shell_list[0]: |
| 949 shell_list[0] = gyp_path_to_build_path(shell_list[0]) | 956 shell_list[0] = gyp_path_to_build_path(shell_list[0]) |
| 950 | 957 |
| 951 # "script.sh" -> "./script.sh" | 958 # "script.sh" -> "./script.sh" |
| 952 if not os.path.sep in shell_list[0]: | 959 if not os.path.sep in shell_list[0]: |
| 953 shell_list[0] = os.path.join('.', shell_list[0]) | 960 shell_list[0] = os.path.join('.', shell_list[0]) |
| 954 postbuilds.append(gyp.common.EncodePOSIXShellList(shell_list)) | 961 postbuilds.append(gyp.common.EncodePOSIXShellList(shell_list)) |
| 955 | 962 |
| 956 return postbuilds | 963 return postbuilds |
| OLD | NEW |