Skip to content

Commit f7005f7

Browse files
authored
Preliminary support for the base component on Windows. (#44)
Progress on #36. Together with some other pending PRs, this gets me enough to 1. Fetch sources 2. Configure with CMake 3. Build without errors Not much is actually getting built, since this disables nearly all projects on Windows, but this is enough to start running CI builds and working on components incrementally.
1 parent 02cae88 commit f7005f7

File tree

2 files changed

+36
-11
lines changed

2 files changed

+36
-11
lines changed

CMakeLists.txt

+13-8
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,19 @@ endif()
109109
# don't be fooled).
110110
add_subdirectory(third-party)
111111
add_subdirectory(base)
112-
add_subdirectory(compiler)
113-
add_subdirectory(core)
114-
add_subdirectory(comm-libs)
115-
if(THEROCK_ENABLE_MATH_LIBS)
116-
add_subdirectory(math-libs)
117-
endif()
118-
if(THEROCK_ENABLE_ML_LIBS)
119-
add_subdirectory(ml-libs)
112+
113+
if(NOT WIN32)
114+
add_subdirectory(compiler)
115+
add_subdirectory(core)
116+
add_subdirectory(comm-libs)
117+
if(THEROCK_ENABLE_MATH_LIBS)
118+
add_subdirectory(math-libs)
119+
endif()
120+
if(THEROCK_ENABLE_ML_LIBS)
121+
add_subdirectory(ml-libs)
122+
endif()
123+
else()
124+
# TODO(#36): Enable more project builds on Windows and/or make the full list configurable.
120125
endif()
121126

122127

base/CMakeLists.txt

+23-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ therock_cmake_subproject_activate(rocm-cmake)
1616
# rocm-core
1717
################################################################################
1818

19+
if(WIN32)
20+
set(_shared_libs_arg "OFF")
21+
else()
22+
set(_shared_libs_arg "ON")
23+
endif()
24+
1925
therock_cmake_subproject_declare(rocm-core
2026
EXTERNAL_SOURCE_DIR "rocm-core"
2127
CMAKE_ARGS
22-
"-DBUILD_SHARED_LIBS=ON"
28+
"-DBUILD_SHARED_LIBS=${_shared_libs_arg}"
2329
"-DROCM_VERSION=${ROCM_MAJOR_VERSION}.${ROCM_MINOR_VERSION}.${ROCM_PATCH_VERSION}"
2430
)
2531
therock_cmake_subproject_glob_c_sources(rocm-core
@@ -33,6 +39,8 @@ therock_cmake_subproject_activate(rocm-core)
3339
# rocm_smi_lib
3440
################################################################################
3541

42+
if(NOT WIN32) # TODO(#36): Enable on Windows and/or make subproject inclusion generally optional
43+
3644
therock_cmake_subproject_declare(rocm_smi_lib
3745
EXTERNAL_SOURCE_DIR "rocm_smi_lib"
3846
INTERFACE_LINK_DIRS
@@ -46,12 +54,16 @@ therock_cmake_subproject_glob_c_sources(rocm_smi_lib
4654
therock_cmake_subproject_provide_package(rocm_smi_lib rocm_smi lib/cmake/rocm_smi)
4755
therock_cmake_subproject_activate(rocm_smi_lib)
4856

57+
endif()
58+
4959

5060
################################################################################
5161
# rocprofiler-register
5262
# This is a stub that helps runtime libraries and profiles rendezvous
5363
################################################################################
5464

65+
if(NOT WIN32) # TODO(#36): Enable on Windows and/or make subproject inclusion generally optional
66+
5567
therock_cmake_subproject_declare(rocprofiler-register
5668
EXTERNAL_SOURCE_DIR "rocprofiler-register"
5769
INTERFACE_LINK_DIRS
@@ -66,6 +78,8 @@ therock_cmake_subproject_provide_package(rocprofiler-register
6678
rocprofiler-register lib/cmake/rocprofiler-register)
6779
therock_cmake_subproject_activate(rocprofiler-register)
6880

81+
endif()
82+
6983

7084
################################################################################
7185
# rocm-half
@@ -87,6 +101,13 @@ therock_cmake_subproject_activate(rocm-half)
87101
# Artifacts
88102
################################################################################
89103

104+
set(_optional_subproject_deps)
105+
if(NOT WIN32)
106+
# TODO(#36): Enable on Windows and/or make subproject inclusion generally optional
107+
list(APPEND _optional_subproject_deps rocm_smi_lib)
108+
list(APPEND _optional_subproject_deps rocprofiler-register)
109+
endif()
110+
90111
therock_provide_artifact(base
91112
TARGET_NEUTRAL
92113
DESCRIPTOR artifact.toml
@@ -98,9 +119,8 @@ therock_provide_artifact(base
98119
run
99120
test
100121
SUBPROJECT_DEPS
122+
${_optional_subproject_deps}
101123
rocm-cmake
102124
rocm-core
103-
rocm_smi_lib
104-
rocprofiler-register
105125
rocm-half
106126
)

0 commit comments

Comments
 (0)