Skip to content

Commit

Permalink
Add compiler check before running module_api and reduction tests (#180)
Browse files Browse the repository at this point in the history
* Add GNU compiler check before compiling module_api and reduction examples
  • Loading branch information
darren-amd authored Nov 18, 2024
1 parent cfbca54 commit 14f07b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion HIP-Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ if(NOT "${GPU_RUNTIME}" STREQUAL "CUDA")
endif()
endif()

add_subdirectory(module_api)
if(
CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.4"
)
# g++ < 10.4 does not support all required C++17 features
else()
add_subdirectory(module_api)
endif()
endif()

if(NOT WIN32)
Expand Down
9 changes: 8 additions & 1 deletion Tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,11 @@ project(Tutorials LANGUAGES CXX)
file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})

add_subdirectory(reduction)
if(
CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.4"
)
# g++ < 10.4 does not support all required C++17 features
else()
add_subdirectory(reduction)
endif()

0 comments on commit 14f07b9

Please sign in to comment.