@@ -89,6 +89,63 @@ def _impl(ctx):
89
89
],
90
90
)
91
91
92
+ cxx17_feature = feature (
93
+ name = "c++17" ,
94
+ enabled = True ,
95
+ flag_sets = [
96
+ flag_set (
97
+ actions = [ACTION_NAMES .cpp_compile ],
98
+ flag_groups = [flag_group (flags = ["-std=c++17" ])],
99
+ ),
100
+ ],
101
+ )
102
+
103
+ no_canonical_prefixes_feature = feature (
104
+ name = "no-canonical-prefixes" ,
105
+ enabled = True ,
106
+ flag_sets = [
107
+ flag_set (
108
+ actions = [
109
+ ACTION_NAMES .c_compile ,
110
+ ACTION_NAMES .cpp_compile ,
111
+ ACTION_NAMES .cpp_link_executable ,
112
+ ACTION_NAMES .cpp_link_dynamic_library ,
113
+ ACTION_NAMES .cpp_link_nodeps_dynamic_library ,
114
+ ],
115
+ flag_groups = [
116
+ flag_group (
117
+ flags = [
118
+ "-no-canonical-prefixes" ,
119
+ ],
120
+ ),
121
+ ],
122
+ ),
123
+ ],
124
+ )
125
+
126
+ opt_feature = feature (
127
+ name = "opt" ,
128
+ enabled = True ,
129
+ flag_sets = [
130
+ flag_set (
131
+ actions = [ACTION_NAMES .c_compile , ACTION_NAMES .cpp_compile ],
132
+ flag_groups = [
133
+ flag_group (
134
+ flags = ["-O3" , "-ffunction-sections" , "-fdata-sections" ],
135
+ ),
136
+ ],
137
+ ),
138
+ flag_set (
139
+ actions = [
140
+ ACTION_NAMES .cpp_link_dynamic_library ,
141
+ ACTION_NAMES .cpp_link_nodeps_dynamic_library ,
142
+ ACTION_NAMES .cpp_link_executable ,
143
+ ],
144
+ flag_groups = [flag_group (flags = ["-Wl,--gc-sections" ])],
145
+ ),
146
+ ],
147
+ )
148
+
92
149
return cc_common .create_cc_toolchain_config_info (
93
150
ctx = ctx ,
94
151
toolchain_identifier = "wasm-toolchain" ,
@@ -107,7 +164,7 @@ def _impl(ctx):
107
164
"external/emscripten_toolchain/upstream/emscripten/system/include/libcxx" ,
108
165
"external/emscripten_toolchain/upstream/emscripten/system/include/libc" ,
109
166
],
110
- # features = [toolchain_include_directories_feature ],
167
+ features = [cxx17_feature , no_canonical_prefixes_feature , opt_feature ],
111
168
)
112
169
113
170
cc_toolchain_config = rule (
0 commit comments