Skip to content

Commit 698f908

Browse files
committed
fix cmake & add date
1 parent 4c1a84c commit 698f908

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.github/workflows/sycl-nightly.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,22 @@ jobs:
2323
git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_linux.dump sycl/test/abi/sycl_symbols_linux-sycl-rel-6_3.dump
2424
git diff --exit-code -I "^# RUN" origin/sycl-rel-6_3:sycl/test/abi/sycl_symbols_windows.dump sycl/test/abi/sycl_symbols_windows-sycl-rel-6_3.dump
2525
26+
get_date:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
date: ${{ steps.get_date.outputs.date }}
30+
steps:
31+
- id: get_date
32+
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
33+
2634
ubuntu2204_build:
35+
needs: get_date
2736
if: github.repository == 'intel/llvm'
2837
uses: ./.github/workflows/sycl-linux-build.yml
2938
secrets: inherit
3039
with:
3140
build_cache_root: "/__w/"
32-
build_configure_extra_args: '--hip --cuda -DSYCL_BUILD_INFO="Nightly"'
41+
build_configure_extra_args: '--hip --cuda -DSYCL_BUILD_INFO="Nightly ${{ needs.get_date.outputs.date }}"'
3342
build_image: ghcr.io/intel/llvm/ubuntu2204_build:latest
3443

3544
retention-days: 90
@@ -183,6 +192,7 @@ jobs:
183192
toolchain_decompress_command: ${{ needs.ubuntu2404_oneapi_build.outputs.toolchain_decompress_command }}
184193

185194
build-win:
195+
needs: get_date
186196
uses: ./.github/workflows/sycl-windows-build.yml
187197
if: github.repository == 'intel/llvm'
188198
with:
@@ -191,7 +201,7 @@ jobs:
191201
# functionality, make sure Linux/Windows names follow the same pattern.
192202
toolchain_artifact_filename: sycl_windows.tar.gz
193203
# Disable the spirv-dis requirement as to not require SPIR-V Tools.
194-
build_configure_extra_args: -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=off -DSYCL_BUILD_INFO="Nightly"
204+
build_configure_extra_args: -DLLVM_SPIRV_ENABLE_LIBSPIRV_DIS=off -DSYCL_BUILD_INFO="Nightly ${{ needs.get_date.outputs.date }}"
195205
build_target: all
196206

197207
e2e-win:

clang/lib/Basic/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@ add_custom_command(OUTPUT "${version_inc}"
4242
"-DLLVM_VC_REVISION=${llvm_vc_revision}"
4343
"-DLLVM_FORCE_VC_REVISION=${LLVM_FORCE_VC_REVISION}"
4444
"-DLLVM_FORCE_VC_REPOSITORY=${LLVM_FORCE_VC_REPOSITORY}"
45+
"-DSYCL_BUILD_INFO=${SYCL_BUILD_INFO}"
4546
-P "${generate_vcs_version_script}")
4647

47-
if(SYCL_BUILD_INFO)
48-
file(APPEND ${version_inc} "#define SYCL_BUILD_INFO \"${SYCL_BUILD_INFO}\"\n")
49-
endif()
50-
5148
# Mark the generated header as being generated.
5249
set_source_files_properties("${version_inc}"
5350
PROPERTIES GENERATED TRUE

llvm/cmake/modules/GenerateVersionFromVCS.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ foreach(name IN LISTS NAMES)
5656
append_info(${name} "${revision}" "${repository}")
5757
endforeach()
5858

59+
if(SYCL_BUILD_INFO)
60+
file(APPEND "${HEADER_FILE}.tmp"
61+
"#define SYCL_BUILD_INFO \"${SYCL_BUILD_INFO}\"\n")
62+
endif()
63+
5964
# Copy the file only if it has changed.
6065
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
6166
"${HEADER_FILE}.tmp" "${HEADER_FILE}")

0 commit comments

Comments
 (0)