Skip to content

Commit 3e7e027

Browse files
committed
Wrap HIP_VERSION_{MAJOR, MINOR, PATCH} in HAS_PARENT_SCOPE
1 parent 69dc2e6 commit 3e7e027

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

amd/hipcc/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
1818
set(ADDITIONAL_SHARED_LIBRARIES_TO_LINK
1919
libstdc++fs.so)
2020

21-
set(HIP_VERSION_MAJOR 4 PARENT_SCOPE)
22-
set(HIP_VERSION_MINOR 4 PARENT_SCOPE)
23-
set(HIP_VERSION_PATCH 4 PARENT_SCOPE)
21+
get_directory_property(HAS_PARENT_SCOPE PARENT_DIRECTORY)
22+
if(HAS_PARENT_SCOPE)
23+
# FIXME(kzhuravl): Do we need these here? If yes, what is the default?
24+
set(HIP_VERSION_MAJOR 4 PARENT_SCOPE)
25+
set(HIP_VERSION_MINOR 4 PARENT_SCOPE)
26+
set(HIP_VERSION_PATCH 4 PARENT_SCOPE)
27+
else()
28+
message(STATUS "Current scope has no parent")
29+
endif()
2430

2531
set(HIPCC_BIN
2632
hipcc.bin)

0 commit comments

Comments
 (0)