Skip to content

Commit 64a711e

Browse files
committed
Minor CMakeLists.txt cleanup:
- Drop minimum cmake version required to 3.13.4 (this matches to other compiler projects) - Drop hipconfig.bin project - Introduce several variables so it is easier to track them - Cosmetic clean up
1 parent 43b4672 commit 64a711e

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

amd/hipcc/CMakeLists.txt

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
1-
cmake_minimum_required(VERSION 3.16.3)
2-
project (hipcc.bin)
1+
cmake_minimum_required(VERSION 3.13.4)
2+
3+
project(hipcc VERSION "1.0.0" LANGUAGES C CXX)
4+
set(hipcc_NAME "${PROJECT_NAME}")
35

4-
# Specify the C++ standard
56
set(CMAKE_CXX_STANDARD 17)
67
set(CMAKE_CXX_STANDARD_REQUIRED True)
78

8-
set (LINK_LIBS libstdc++fs.so)
9-
add_executable(hipcc.bin src/hipBin.cpp)
10-
if (NOT WIN32) # C++17 does not require the std lib linking
11-
target_link_libraries(hipcc.bin ${LINK_LIBS} ) # for hipcc.bin
12-
endif()
13-
14-
project (hipconfig.bin)
15-
add_executable(hipconfig.bin src/hipBin.cpp)
16-
if (NOT WIN32) # C++17 does not require the std lib linking
17-
target_link_libraries(hipconfig.bin ${LINK_LIBS} ) # for hipconfig.bin
18-
endif()
9+
set(ADDITIONAL_SHARED_LIBRARIES_TO_LINK
10+
libstdc++fs.so)
1911

2012
set(HIP_VERSION_MAJOR 4 PARENT_SCOPE)
2113
set(HIP_VERSION_MINOR 4 PARENT_SCOPE)
2214
set(HIP_VERSION_PATCH 4 PARENT_SCOPE)
15+
16+
set(HIPCC_BIN
17+
hipcc.bin)
18+
set(HIPCC_SOURCES
19+
src/hipBin.cpp)
20+
21+
set(HIPCONFIG_BIN
22+
hipconfig.bin)
23+
set(HIPCONFIG_SOURCES
24+
src/hipBin.cpp)
25+
26+
add_executable(${HIPCC_BIN} ${HIPCC_SOURCES})
27+
if(NOT WIN32)
28+
# C++17 does not require std lib linking.
29+
target_link_libraries(${HIPCC_BIN} ${ADDITIONAL_SHARED_LIBRARIES_TO_LINK})
30+
endif()
31+
32+
add_executable(${HIPCONFIG_BIN} ${HIPCONFIG_SOURCES})
33+
if(NOT WIN32)
34+
# C++17 does not require std lib linking.
35+
target_link_libraries(${HIPCONFIG_BIN} ${ADDITIONAL_SHARED_LIBRARIES_TO_LINK})
36+
endif()

0 commit comments

Comments
 (0)