File tree Expand file tree Collapse file tree 2 files changed +42
-13
lines changed Expand file tree Collapse file tree 2 files changed +42
-13
lines changed Original file line number Diff line number Diff line change 26
26
27
27
function (get_level_zero_headers )
28
28
29
- # Clone the Level Zero git repo
30
- execute_process (
31
- COMMAND ${GIT_EXECUTABLE} clone https://github.com/oneapi-src/level-zero.git
32
- RESULT_VARIABLE result
33
- ERROR_VARIABLE error
34
- OUTPUT_STRIP_TRAILING_WHITESPACE
35
- ERROR_STRIP_TRAILING_WHITESPACE
36
- )
29
+ if (EXISTS level-zero )
30
+ # Update the checkout
31
+ execute_process (
32
+ COMMAND ${GIT_EXECUTABLE} pull
33
+ RESULT_VARIABLE result
34
+ ERROR_VARIABLE error
35
+ OUTPUT_STRIP_TRAILING_WHITESPACE
36
+ ERROR_STRIP_TRAILING_WHITESPACE
37
+ )
37
38
38
- if (NOT result EQUAL 0 )
39
- message (FATAL_ERROR
40
- "Could not clone the Level Zero sources."
39
+ if (NOT result EQUAL 0 )
40
+ message (FATAL_ERROR
41
+ "Could not update Level Zero sources."
42
+ )
43
+ endif ()
44
+ else ()
45
+ # Clone the Level Zero git repo
46
+ execute_process (
47
+ COMMAND ${GIT_EXECUTABLE} clone https://github.com/oneapi-src/level-zero.git
48
+ RESULT_VARIABLE result
49
+ ERROR_VARIABLE error
50
+ OUTPUT_STRIP_TRAILING_WHITESPACE
51
+ ERROR_STRIP_TRAILING_WHITESPACE
41
52
)
53
+
54
+ if (NOT result EQUAL 0 )
55
+ message (FATAL_ERROR
56
+ "Could not clone Level Zero sources from github.com/oneapi-src/level-zero."
57
+ )
58
+ endif ()
42
59
endif ()
43
60
44
61
# Use git describe to get latest tag name
Original file line number Diff line number Diff line change 45
45
dpctl_dir = os .getcwd ()
46
46
build_cmake_dir = os .path .join (dpctl_dir , "build_cmake" )
47
47
if os .path .exists (build_cmake_dir ):
48
- shutil .rmtree (build_cmake_dir )
49
- os .mkdir (build_cmake_dir )
48
+ for f in os .listdir (build_cmake_dir ):
49
+ f_path = os .path .join (build_cmake_dir , f )
50
+ if os .path .isdir (f_path ):
51
+ if (f == "level-zero" ) and os .path .isdir (
52
+ os .path .join (f_path , ".git" )
53
+ ):
54
+ # do not delete Git checkout of level zero headers
55
+ pass
56
+ else :
57
+ shutil .rmtree (f_path )
58
+ else :
59
+ os .remove (f_path )
60
+ else :
61
+ os .mkdir (build_cmake_dir )
50
62
os .chdir (build_cmake_dir )
51
63
52
64
INSTALL_PREFIX = os .path .join (dpctl_dir , "install" )
You can’t perform that action at this time.
0 commit comments