| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8824adb commit 6ad5353
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,12 @@ | |||
| 1 | 1 | # Changelog | |
| 2 | 2 | ||
| 3 | + ## [0.16.2](https://github.com/nodejs/gyp-next/compare/v0.16.1...v0.16.2) (2024-03-07) | ||
| 4 | + | ||
| 5 | + | ||
| 6 | + ### Bug Fixes | ||
| 7 | + | ||
| 8 | + * avoid quoting cflag name and parameter with space separator ([#223](https://github.com/nodejs/gyp-next/issues/223)) ([2b9703d](https://github.com/nodejs/gyp-next/commit/2b9703dbd5b3b8a935faf257c6103033b47bf8bf)) | ||
| 9 | + | ||
| 3 | 10 | ## [0.16.1](https://github.com/nodejs/gyp-next/compare/v0.16.0...v0.16.1) (2023-10-25) | |
| 4 | 11 | ||
| 5 | 12 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -579,7 +579,8 @@ def GetCflags(self, configname, arch=None): | |||
| 579 | 579 | ||
| 580 | 580 | sdk_root = self._SdkPath() | |
| 581 | 581 | if "SDKROOT" in self._Settings() and sdk_root: | |
| 582 | - cflags.append("-isysroot %s" % sdk_root) | ||
| 582 | + cflags.append("-isysroot") | ||
| 583 | + cflags.append(sdk_root) | ||
| 583 | 584 | ||
| 584 | 585 | if self.header_map_path: | |
| 585 | 586 | cflags.append("-I%s" % self.header_map_path) | |
@@ -664,7 +665,8 @@ def GetCflags(self, configname, arch=None): | |||
| 664 | 665 | # TODO: Supporting fat binaries will be annoying. | |
| 665 | 666 | self._WarnUnimplemented("ARCHS") | |
| 666 | 667 | archs = ["i386"] | |
| 667 | - cflags.append("-arch " + archs[0]) | ||
| 668 | + cflags.append("-arch") | ||
| 669 | + cflags.append(archs[0]) | ||
| 668 | 670 | ||
| 669 | 671 | if archs[0] in ("i386", "x86_64"): | |
| 670 | 672 | if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"): | |
@@ -924,17 +926,15 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): | |||
| 924 | 926 | self._AppendPlatformVersionMinFlags(ldflags) | |
| 925 | 927 | ||
| 926 | 928 | if "SDKROOT" in self._Settings() and self._SdkPath(): | |
| 927 | - ldflags.append("-isysroot " + self._SdkPath()) | ||
| 929 | + ldflags.append("-isysroot") | ||
| 930 | + ldflags.append(self._SdkPath()) | ||
| 928 | 931 | ||
| 929 | 932 | for library_path in self._Settings().get("LIBRARY_SEARCH_PATHS", []): | |
| 930 | 933 | ldflags.append("-L" + gyp_to_build_path(library_path)) | |
| 931 | 934 | ||
| 932 | 935 | if "ORDER_FILE" in self._Settings(): | |
| 933 | - ldflags.append( | ||
| 934 | - "-Wl,-order_file " | ||
| 935 | - + "-Wl," | ||
| 936 | - + gyp_to_build_path(self._Settings()["ORDER_FILE"]) | ||
| 937 | - ) | ||
| 936 | + ldflags.append("-Wl,-order_file") | ||
| 937 | + ldflags.append("-Wl," + gyp_to_build_path(self._Settings()["ORDER_FILE"])) | ||
| 938 | 938 | ||
| 939 | 939 | if not gyp.common.CrossCompileRequested(): | |
| 940 | 940 | if arch is not None: | |
@@ -946,15 +946,18 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): | |||
| 946 | 946 | # TODO: Supporting fat binaries will be annoying. | |
| 947 | 947 | self._WarnUnimplemented("ARCHS") | |
| 948 | 948 | archs = ["i386"] | |
| 949 | - ldflags.append("-arch " + archs[0]) | ||
| 949 | + # Avoid quoting the space between -arch and the arch name | ||
| 950 | + ldflags.append("-arch") | ||
| 951 | + ldflags.append(archs[0]) | ||
| 950 | 952 | ||
| 951 | 953 | # Xcode adds the product directory by default. | |
| 952 | 954 | # Rewrite -L. to -L./ to work around http://www.openradar.me/25313838 | |
| 953 | 955 | ldflags.append("-L" + (product_dir if product_dir != "." else "./")) | |
| 954 | 956 | ||
| 955 | 957 | install_name = self.GetInstallName() | |
| 956 | 958 | if install_name and self.spec["type"] != "loadable_module": | |
| 957 | - ldflags.append("-install_name " + install_name.replace(" ", r"\ ")) | ||
| 959 | + ldflags.append("-install_name") | ||
| 960 | + ldflags.append(install_name.replace(" ", r"\ ")) | ||
| 958 | 961 | ||
| 959 | 962 | for rpath in self._Settings().get("LD_RUNPATH_SEARCH_PATHS", []): | |
| 960 | 963 | ldflags.append("-Wl,-rpath," + rpath) | |
@@ -971,7 +974,8 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): | |||
| 971 | 974 | platform_root = self._XcodePlatformPath(configname) | |
| 972 | 975 | if sdk_root and platform_root: | |
| 973 | 976 | ldflags.append("-F" + platform_root + "/Developer/Library/Frameworks/") | |
| 974 | - ldflags.append("-framework XCTest") | ||
| 977 | + ldflags.append("-framework") | ||
| 978 | + ldflags.append("XCTest") | ||
| 975 | 979 | ||
| 976 | 980 | is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() | |
| 977 | 981 | if sdk_root and is_extension: | |
@@ -987,7 +991,8 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): | |||
| 987 | 991 | + "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit" | |
| 988 | 992 | ) | |
| 989 | 993 | else: | |
| 990 | - ldflags.append("-e _NSExtensionMain") | ||
| 994 | + ldflags.append("-e") | ||
| 995 | + ldflags.append("_NSExtensionMain") | ||
| 991 | 996 | ldflags.append("-fapplication-extension") | |
| 992 | 997 | ||
| 993 | 998 | self._Appendf(ldflags, "CLANG_CXX_LIBRARY", "-stdlib=%s") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,53 @@ | |||
| 1 | + #!/usr/bin/env python3 | ||
| 2 | + | ||
| 3 | + """Unit tests for the xcode_emulation.py file.""" | ||
| 4 | + | ||
| 5 | + from gyp.xcode_emulation import XcodeSettings | ||
| 6 | + import sys | ||
| 7 | + import unittest | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + class TestXcodeSettings(unittest.TestCase): | ||
| 11 | + def setUp(self): | ||
| 12 | + if sys.platform != "darwin": | ||
| 13 | + self.skipTest("This test only runs on macOS") | ||
| 14 | + | ||
| 15 | + def test_GetCflags(self): | ||
| 16 | + target = { | ||
| 17 | + "type": "static_library", | ||
| 18 | + "configurations": { | ||
| 19 | + "Release": {}, | ||
| 20 | + }, | ||
| 21 | + } | ||
| 22 | + configuration_name = "Release" | ||
| 23 | + xcode_settings = XcodeSettings(target) | ||
| 24 | + cflags = xcode_settings.GetCflags(configuration_name, "arm64") | ||
| 25 | + | ||
| 26 | + # Do not quote `-arch arm64` with spaces in one string. | ||
| 27 | + self.assertEqual( | ||
| 28 | + cflags, | ||
| 29 | + ["-fasm-blocks", "-mpascal-strings", "-Os", "-gdwarf-2", "-arch", "arm64"], | ||
| 30 | + ) | ||
| 31 | + | ||
| 32 | + def GypToBuildPath(self, path): | ||
| 33 | + return path | ||
| 34 | + | ||
| 35 | + def test_GetLdflags(self): | ||
| 36 | + target = { | ||
| 37 | + "type": "static_library", | ||
| 38 | + "configurations": { | ||
| 39 | + "Release": {}, | ||
| 40 | + }, | ||
| 41 | + } | ||
| 42 | + configuration_name = "Release" | ||
| 43 | + xcode_settings = XcodeSettings(target) | ||
| 44 | + ldflags = xcode_settings.GetLdflags( | ||
| 45 | + configuration_name, "PRODUCT_DIR", self.GypToBuildPath, "arm64" | ||
| 46 | + ) | ||
| 47 | + | ||
| 48 | + # Do not quote `-arch arm64` with spaces in one string. | ||
| 49 | + self.assertEqual(ldflags, ["-arch", "arm64", "-LPRODUCT_DIR"]) | ||
| 50 | + | ||
| 51 | + | ||
| 52 | + if __name__ == "__main__": | ||
| 53 | + unittest.main() | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |||
| 4 | 4 | ||
| 5 | 5 | [project] | |
| 6 | 6 | name = "gyp-next" | |
| 7 | - version = "0.16.1" | ||
| 7 | + version = "0.16.2" | ||
| 8 | 8 | authors = [ | |
| 9 | 9 | { name="Node.js contributors", email="ryzokuken@disroot.org" }, | |
| 10 | 10 | ] | |
@@ -29,7 +29,7 @@ classifiers = [ | |||
| 29 | 29 | ] | |
| 30 | 30 | ||
| 31 | 31 | [project.optional-dependencies] | |
| 32 | - dev = ["flake8", "ruff", "pytest"] | ||
| 32 | + dev = ["flake8", "ruff == 0.3.0", "pytest"] | ||
| 33 | 33 | ||
| 34 | 34 | [project.scripts] | |
| 35 | 35 | gyp = "gyp:script_main" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments