Skip to content

Commit abfd20d

Browse files
authored
[tools] Add missing linker features for linux toolchain (#1304)
* [tools] Respect HXCPP_DEBUG_LINK on linux * [tools] Respect HXCPP_OPTIMIZE_LINK on linux
1 parent b833217 commit abfd20d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

toolchain/linux-toolchain.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@
3636
<compiler id="linux" exe="g++" if="linux">
3737
<exe name="${CXX}" if="CXX" />
3838
<flag value="-c"/>
39+
<flag value="-flto" if="HXCPP_OPTIMIZE_LINK" unless="debug"/>
3940
<flag value="-fvisibility=hidden"/>
4041
<cppflag value="-frtti"/>
41-
<flag value="-g" if="debug"/>
42+
<flag value="-g" if="HXCPP_DEBUG_LINK"/>
4243
<flag value="-O2" unless="debug"/>
4344
<flag value="-fpic"/>
4445
<flag value="-fPIC"/>
@@ -69,7 +70,7 @@
6970
<flag value="-m64" if="HXCPP_M64" unless="noM64" />
7071
<flag value="-Xlinker"/>
7172
<flag value="--no-undefined" unless="HXCPP_ALLOW_UNDEFINED" />
72-
<flag value="-debug" if="debug"/>
73+
<flag value="-debug" if="HXCPP_DEBUG_LINK" />
7374
<lib name="-ldl"/>
7475
<ext value=".dso"/>
7576
<outflag value="-o "/>
@@ -78,7 +79,7 @@
7879
<linker id="exe" exe="g++" if="linux">
7980
<exe name="${CXX}" if="CXX" />
8081
<fromfile value="" if="GCC_OLD" />
81-
<flag value="-debug" if="debug"/>
82+
<flag value="-debug" if="HXCPP_DEBUG_LINK" />
8283
<flag value="-rdynamic"/>
8384
<flag value="-m32" unless="noM32"/>
8485
<flag value="-m64" if="HXCPP_M64" unless="noM64" />

0 commit comments

Comments
 (0)