Skip to content

Commit

Permalink
add compiler flag to enable c++17 support (#1116)
Browse files Browse the repository at this point in the history
  • Loading branch information
acarioni authored Jun 25, 2024
1 parent e1798e6 commit f376d04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion toolchain/linux-toolchain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</section>
</section>

<set name="HXCPP_CPP11" value="1" unless="HXCPP_NO_CPP11" />
<set name="HXCPP_CPP11" value="1" unless="HXCPP_NO_CPP11 || HXCPP_CPP17" />

<include name="toolchain/gcc-toolchain.xml"/>
<set name="noM32" value="1" if="HXCPP_NO_M32" />
Expand All @@ -41,6 +41,7 @@
<flag value="-fvisibility=hidden"/>
<cppflag value="-frtti"/>
<cppflag value="-std=c++11" if="HXCPP_CPP11" />
<cppflag value="-std=c++17" if="HXCPP_CPP17"/>
<flag value="-g" if="debug"/>
<flag value="-O2" unless="debug"/>
<flag value="-fpic"/>
Expand Down
8 changes: 5 additions & 3 deletions toolchain/mac-toolchain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<!-- MACOS TOOLS -->

<set name="HXCPP_USE_LIBTOOL" value="1" />
<set name="HXCPP_CPP11" value="1" unless="HXCPP_NO_CPP11 || HXCPP_CPP14" />
<set name="HXCPP_CPP11" value="1" unless="HXCPP_NO_CPP11 || HXCPP_CPP14 || HXCPP_CPP17" />


<include name="toolchain/gcc-toolchain.xml"/>
<setenv name="MACOSX_DEPLOYMENT_TARGET" value="10.9" if="HXCPP_CPP11||HXCPP_CPP14" unless="MACOSX_DEPLOYMENT_TARGET"/>
<setenv name="MACOSX_DEPLOYMENT_TARGET" value="10.9" if="HXCPP_CPP11||HXCPP_CPP14||HXCPP_CPP17" unless="MACOSX_DEPLOYMENT_TARGET"/>
<setenv name="MACOSX_DEPLOYMENT_TARGET" value="10.7" if="OBJC_ARC" unless="MACOSX_DEPLOYMENT_TARGET" />
<setenv name="MACOSX_DEPLOYMENT_TARGET" value="10.6" unless="MACOSX_DEPLOYMENT_TARGET" />
<path name="${DEVELOPER_DIR}/usr/bin" />
<set name="HXCPP_LTO_THIN" value="1" if="HXCPP_OPTIMIZE_LINK_INCREMENTAL"/>

<set name="STDLIBCPP" value="1" unless="HXCPP_GCC || HXCPP_CPP11 || HXCPP_CPP14" />
<set name="STDLIBCPP" value="1" unless="HXCPP_GCC || HXCPP_CPP11 || HXCPP_CPP14 || HXCPP_CPP17" />


<section unless="HXCPP_ARCH">
Expand All @@ -29,6 +29,8 @@
<cppflag value="-std=c++11" if="HXCPP_CPP11"/>
<cppflag value="-std=c++14" if="HXCPP_CPP14"/>
<cppflag value="-Wc++14-extensions" if="HXCPP_CPP14"/>
<cppflag value="-std=c++17" if="HXCPP_CPP17"/>
<cppflag value="-Wc++17-extensions" if="HXCPP_CPP17"/>
<flag value="-stdlib=libc++" unless="STDLIBCPP" />
<flag value="-stdlib=libstdc++" if="STDLIBCPP" />
<cppflag value="-frtti"/>
Expand Down
1 change: 1 addition & 0 deletions toolchain/msvc-toolchain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<flag value="-DHXCPP_BIG_ENDIAN" if="HXCPP_BIG_ENDIAN"/>
<flag value="-D${HXCPP_XP_DEFINE}" if="HXCPP_XP_DEFINE"/>
<flag value="-GR"/>
<flag value="/std:c++17" if="HXCPP_CPP17"/>

<!-- standard optimization flags -->
<flag value="-Od" if="debug" tag="optim-std" />
Expand Down

0 comments on commit f376d04

Please sign in to comment.