| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 60f008b commit 51ea5b6
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ template("base64_gn_build") { | |||
| 19 | 19 | } else { | |
| 20 | 20 | defines = [] | |
| 21 | 21 | } | |
| 22 | - if (target_cpu == "x86" || target_cpu == "x64") { | ||
| 22 | + if (current_cpu == "x86" || current_cpu == "x64") { | ||
| 23 | 23 | defines += [ | |
| 24 | 24 | "HAVE_SSSE3=1", | |
| 25 | 25 | "HAVE_SSE41=1", | |
@@ -29,10 +29,10 @@ template("base64_gn_build") { | |||
| 29 | 29 | "HAVE_AVX512=1", | |
| 30 | 30 | ] | |
| 31 | 31 | } | |
| 32 | - if (target_cpu == "arm") { | ||
| 32 | + if (current_cpu == "arm") { | ||
| 33 | 33 | defines += [ "HAVE_NEON32=1" ] | |
| 34 | 34 | } | |
| 35 | - if (target_cpu == "arm64") { | ||
| 35 | + if (current_cpu == "arm64") { | ||
| 36 | 36 | defines += [ "HAVE_NEON64=1" ] | |
| 37 | 37 | } | |
| 38 | 38 | if (is_clang || !is_win) { | |
@@ -69,7 +69,7 @@ template("base64_gn_build") { | |||
| 69 | 69 | source_set("base64_ssse3") { | |
| 70 | 70 | configs += [ ":base64_internal_config" ] | |
| 71 | 71 | sources = [ "base64/lib/arch/ssse3/codec.c" ] | |
| 72 | - if (target_cpu == "x86" || target_cpu == "x64") { | ||
| 72 | + if (current_cpu == "x86" || current_cpu == "x64") { | ||
| 73 | 73 | if (is_clang || !is_win) { | |
| 74 | 74 | cflags_c = [ "-mssse3" ] | |
| 75 | 75 | } | |
@@ -79,7 +79,7 @@ template("base64_gn_build") { | |||
| 79 | 79 | source_set("base64_sse41") { | |
| 80 | 80 | configs += [ ":base64_internal_config" ] | |
| 81 | 81 | sources = [ "base64/lib/arch/sse41/codec.c" ] | |
| 82 | - if (target_cpu == "x86" || target_cpu == "x64") { | ||
| 82 | + if (current_cpu == "x86" || current_cpu == "x64") { | ||
| 83 | 83 | if (is_clang || !is_win) { | |
| 84 | 84 | cflags_c = [ "-msse4.1" ] | |
| 85 | 85 | } | |
@@ -89,7 +89,7 @@ template("base64_gn_build") { | |||
| 89 | 89 | source_set("base64_sse42") { | |
| 90 | 90 | configs += [ ":base64_internal_config" ] | |
| 91 | 91 | sources = [ "base64/lib/arch/sse42/codec.c" ] | |
| 92 | - if (target_cpu == "x86" || target_cpu == "x64") { | ||
| 92 | + if (current_cpu == "x86" || current_cpu == "x64") { | ||
| 93 | 93 | if (is_clang || !is_win) { | |
| 94 | 94 | cflags_c = [ "-msse4.2" ] | |
| 95 | 95 | } | |
@@ -99,7 +99,7 @@ template("base64_gn_build") { | |||
| 99 | 99 | source_set("base64_avx") { | |
| 100 | 100 | configs += [ ":base64_internal_config" ] | |
| 101 | 101 | sources = [ "base64/lib/arch/avx/codec.c" ] | |
| 102 | - if (target_cpu == "x86" || target_cpu == "x64") { | ||
| 102 | + if (current_cpu == "x86" || current_cpu == "x64") { | ||
| 103 | 103 | if (is_clang || !is_win) { | |
| 104 | 104 | cflags_c = [ "-mavx" ] | |
| 105 | 105 | } else if (is_win) { | |
@@ -111,7 +111,7 @@ template("base64_gn_build") { | |||
| 111 | 111 | source_set("base64_avx2") { | |
| 112 | 112 | configs += [ ":base64_internal_config" ] | |
| 113 | 113 | sources = [ "base64/lib/arch/avx2/codec.c" ] | |
| 114 | - if (target_cpu == "x86" || target_cpu == "x64") { | ||
| 114 | + if (current_cpu == "x86" || current_cpu == "x64") { | ||
| 115 | 115 | if (is_clang || !is_win) { | |
| 116 | 116 | cflags_c = [ "-mavx2" ] | |
| 117 | 117 | } else if (is_win) { | |
@@ -123,7 +123,7 @@ template("base64_gn_build") { | |||
| 123 | 123 | source_set("base64_avx512") { | |
| 124 | 124 | configs += [ ":base64_internal_config" ] | |
| 125 | 125 | sources = [ "base64/lib/arch/avx512/codec.c" ] | |
| 126 | - if (target_cpu == "x86" || target_cpu == "x64") { | ||
| 126 | + if (current_cpu == "x86" || current_cpu == "x64") { | ||
| 127 | 127 | if (is_clang || !is_win) { | |
| 128 | 128 | cflags_c = [ | |
| 129 | 129 | "-mavx512vl", | |
@@ -138,7 +138,7 @@ template("base64_gn_build") { | |||
| 138 | 138 | source_set("base64_neon32") { | |
| 139 | 139 | configs += [ ":base64_internal_config" ] | |
| 140 | 140 | sources = [ "base64/lib/arch/neon32/codec.c" ] | |
| 141 | - if (target_cpu == "arm") { | ||
| 141 | + if (current_cpu == "arm") { | ||
| 142 | 142 | if (is_clang || !is_win) { | |
| 143 | 143 | cflags_c = [ "-mfpu=neon" ] | |
| 144 | 144 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,29 +95,29 @@ template("openssl_gn_build") { | |||
| 95 | 95 | ||
| 96 | 96 | config_path_name = "" | |
| 97 | 97 | if (is_win) { | |
| 98 | - if (target_cpu == "x86") { | ||
| 98 | + if (current_cpu == "x86") { | ||
| 99 | 99 | config_path_name = "VC-WIN32" | |
| 100 | - } else if (target_cpu == "x64") { | ||
| 100 | + } else if (current_cpu == "x64") { | ||
| 101 | 101 | config_path_name = "VC-WIN64A" | |
| 102 | - } else if (target_cpu == "arm64") { | ||
| 102 | + } else if (current_cpu == "arm64") { | ||
| 103 | 103 | config_path_name = "VC-WIN64-ARM" | |
| 104 | 104 | } | |
| 105 | 105 | } else if (is_linux) { | |
| 106 | - if (target_cpu == "x86") { | ||
| 106 | + if (current_cpu == "x86") { | ||
| 107 | 107 | config_path_name = "linux-elf" | |
| 108 | - } else if (target_cpu == "x64") { | ||
| 108 | + } else if (current_cpu == "x64") { | ||
| 109 | 109 | config_path_name = "linux-x86_64" | |
| 110 | - } else if (target_cpu == "arm") { | ||
| 110 | + } else if (current_cpu == "arm") { | ||
| 111 | 111 | config_path_name = "linux-armv4" | |
| 112 | - } else if (target_cpu == "arm64") { | ||
| 112 | + } else if (current_cpu == "arm64") { | ||
| 113 | 113 | config_path_name = "linux-aarch64" | |
| 114 | 114 | } | |
| 115 | 115 | } else if (is_apple) { | |
| 116 | - if (target_cpu == "x86") { | ||
| 116 | + if (current_cpu == "x86") { | ||
| 117 | 117 | config_path_name = "darwin-i386-cc" | |
| 118 | - } else if (target_cpu == "x64") { | ||
| 118 | + } else if (current_cpu == "x64") { | ||
| 119 | 119 | config_path_name = "darwin64-x86_64-cc" | |
| 120 | - } else if (target_cpu == "arm64") { | ||
| 120 | + } else if (current_cpu == "arm64") { | ||
| 121 | 121 | config_path_name = "darwin64-arm64-cc" | |
| 122 | 122 | } | |
| 123 | 123 | } | |
@@ -132,7 +132,7 @@ template("openssl_gn_build") { | |||
| 132 | 132 | # TODO(zcbenz): Check gas_version and nasm_version. | |
| 133 | 133 | asm_name = "asm_avx2" | |
| 134 | 134 | } | |
| 135 | - if (is_win && target_cpu == "arm64") { | ||
| 135 | + if (is_win && current_cpu == "arm64") { | ||
| 136 | 136 | asm_name = "no-asm" | |
| 137 | 137 | } | |
| 138 | 138 | config_path = "config/archs/" + config_path_name + "/" + asm_name | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,8 +54,10 @@ declare_args() { | |||
| 54 | 54 | node_use_node_code_cache = host_os == target_os && host_cpu == target_cpu | |
| 55 | 55 | ||
| 56 | 56 | # Use snapshot to speed up startup. | |
| 57 | - # TODO(zcbenz): node_mksnapshot is not ready for cross-os compilation. | ||
| 58 | - node_use_node_snapshot = host_os == target_os | ||
| 57 | + # TODO(zcbenz): There are few broken things for now: | ||
| 58 | + # 1. cross-os compilation is not supported. | ||
| 59 | + # 2. node_mksnapshot crashes when cross-compiling for x64 from arm64. | ||
| 60 | + node_use_node_snapshot = (host_os == target_os) && !(host_cpu == "arm64" && target_cpu == "x64") | ||
| 59 | 61 | } | |
| 60 | 62 | ||
| 61 | 63 | assert(!node_enable_inspector || node_use_openssl, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,10 +82,10 @@ template("node_gn_build") { | |||
| 82 | 82 | "-Wno-unused-function", | |
| 83 | 83 | ] | |
| 84 | 84 | ||
| 85 | - if (target_cpu == "x86") { | ||
| 85 | + if (current_cpu == "x86") { | ||
| 86 | 86 | node_arch = "ia32" | |
| 87 | 87 | } else { | |
| 88 | - node_arch = target_cpu | ||
| 88 | + node_arch = current_cpu | ||
| 89 | 89 | } | |
| 90 | 90 | if (target_os == "win") { | |
| 91 | 91 | node_platform = "win32" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments