From 76ea65c212581349da78551921a492781487c39b Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 31 Jul 2019 16:25:15 -0400 Subject: [PATCH] Fix -std=c++14 for windows [ROCm/hip commit: f467cb850e463ec5a23ec5c39032c0618c1efc57] --- projects/hip/bin/hipcc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/projects/hip/bin/hipcc b/projects/hip/bin/hipcc index 85e090c761..1eda99b936 100755 --- a/projects/hip/bin/hipcc +++ b/projects/hip/bin/hipcc @@ -195,7 +195,12 @@ if ($HIP_PLATFORM eq "clang") { print ("DEVICE_LIB_PATH=$DEVICE_LIB_PATH\n"); } - $HIPCXXFLAGS .= " -std=c++11 -isystem $HIP_CLANG_INCLUDE_PATH"; + if ($isWindows) { + $HIPCXXFLAGS .= " -std=c++14 -fms-extensions -fms-compatibility"; + } else { + $HIPCXXFLAGS .= " -std=c++11"; + } + $HIPCXXFLAGS .= " -isystem $HIP_CLANG_INCLUDE_PATH"; $HIPLDFLAGS .= " -L$HIP_LIB_PATH"; if (not $isWindows) { $HIPLDFLAGS .= " -Wl,--rpath-link=$HIP_LIB_PATH"; @@ -876,9 +881,7 @@ if ($HIP_PLATFORM eq "clang") { } $HIP_DEVLIB_FLAGS = " --hip-device-lib-path=$DEVICE_LIB_PATH"; $HIPCXXFLAGS .= " $HIP_DEVLIB_FLAGS"; - if ($isWindows) { - $HIPCXXFLAGS .= " -std=c++14 -fms-extensions -fms-compatibility"; - } else { + if (not $isWindows) { $HIPLDFLAGS .= " -lgcc_s -lgcc -lpthread -lm"; } }