Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
C++17 become stable after GCC 7
Browse files Browse the repository at this point in the history
  • Loading branch information
dezhliao committed Sep 27, 2024
1 parent 6622a11 commit e9fa67a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion libhsakmt/tests/kfdtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,13 @@ message( STATUS "PROJECT_SOURCE_DIR:" ${PROJECT_SOURCE_DIR} )
# message(STATUS "${file}")
#endforeach()

#add_definitions(-Wall -std=c++17)

if ( "${CMAKE_C_COMPILER_VERSION}" STRGREATER "4.8.0")
## Add --enable-new-dtags to generate DT_RUNPATH
set ( CMAKE_CXX_FLAGS "-std=gnu++17 -Wl,--enable-new-dtags" )
elseif ( "${CMAKE_C_COMPILER_VERSION}" STRGREATER "7.5.0")
## c++17 become stable after GCC 7
set ( CMAKE_CXX_FLAGS "-std=c++17 -Wl,--enable-new-dtags" )
endif()
if ( "${CMAKE_BUILD_TYPE}" STREQUAL Release )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2" )
Expand Down
2 changes: 1 addition & 1 deletion runtime/hsa-runtime-tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ set( OPEN_SOURCE_DIR ${OPEN_SOURCE_DIR} CACHE PATH "Open source root dir" FORCE
set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../../lib;$ORIGIN/../../lib64;$ORIGIN/../lib64")

## ------------------------- Linux Compiler and Linker options -------------------------
set ( CMAKE_CXX_FLAGS "-std=c++11 ")
set ( CMAKE_CXX_FLAGS "-std=c++17 ")

set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type -Werror -fexceptions -fno-rtti -fvisibility=hidden -Wno-error=sign-compare -Wno-error=enum-compare -Wno-sign-compare -Wno-write-strings -Wno-deprecated-declarations -Wno-conversion-null -fno-math-errno -fno-threadsafe-statics -fmerge-all-constants -fms-extensions -Wno-error=comment -Wno-comment -Wno-error=pointer-arith -Wno-pointer-arith -fPIC" )

Expand Down
2 changes: 1 addition & 1 deletion runtime/hsa-runtime/core/util/atomic_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
////////////////////////////////////////////////////////////////////////////////

/*
Helpers to use native types with C++11 atomic operations.
Helpers to use native types with C++17 atomic operations.
Fixes GCC builtin functionality for x86 with respect to WC and non-temporal
stores.
*/
Expand Down

0 comments on commit e9fa67a

Please sign in to comment.