Skip to content

Commit

Permalink
[SYCLomatic][CMake] Add migration support for `set_source_files_prope…
Browse files Browse the repository at this point in the history
…rties` (#1870)
the-slow-one authored Apr 23, 2024
1 parent 74046f6 commit a8716a3
Showing 4 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: rm -rf %T && mkdir -p %T
// RUN: cd %T
// RUN: cp %S/input.cmake ./input.cmake
// RUN: dpct -in-root ./ -out-root out ./input.cmake --migrate-build-script-only
// RUN: echo "begin" > %T/diff.txt
// RUN: diff --strip-trailing-cr %S/expected.txt %T/out/input.cmake >> %T/diff.txt
// RUN: echo "end" >> %T/diff.txt

// CHECK: begin
// CHECK-NEXT: end
11 changes: 11 additions & 0 deletions clang/test/dpct/cmake_migration/case_042/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# simplest case
set_source_files_properties(${src_files} PROPERTIES LANGUAGE CXX)

# add space test
set_source_files_properties(${src_files} PROPERTIES LANGUAGE CXX)

# with more properties after LANGUAGE
set_source_files_properties(${src_files} PROPERTIES LANGUAGE CXX COMPILE_DEFINITIONS SOME_DEFINE)

# add properties on right
set_source_files_properties(${src_files} PROPERTIES COMPILE_FLAGS "--some-flag" LANGUAGE CXX COMPILE_DEFINITIONS)
11 changes: 11 additions & 0 deletions clang/test/dpct/cmake_migration/case_042/input.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# simplest case
set_source_files_properties(${src_files} PROPERTIES LANGUAGE CUDA)

# add space test
set_source_files_properties (${src_files} PROPERTIES LANGUAGE CUDA)

# with more properties after LANGUAGE
set_source_files_properties(${src_files} PROPERTIES LANGUAGE CUDA COMPILE_DEFINITIONS SOME_DEFINE)

# add properties on right
set_source_files_properties(${src_files} PROPERTIES COMPILE_FLAGS "--some-flag" LANGUAGE CUDA COMPILE_DEFINITIONS)
Original file line number Diff line number Diff line change
@@ -2241,3 +2241,10 @@
Out: ONEAPI_LIB_DIR
MatchMode: Full
RuleId: "replace_cuda_toolkit_lib_with_oneapi_lib"

- Rule: rule_set_source_files_properties
Kind: CMakeRule
Priority: Fallback
CmakeSyntax: set_source_files_properties_lang
In: set_source_files_properties${empty}(${src_files} PROPERTIES${some_other_prop}LANGUAGE CUDA${other_props})
Out: set_source_files_properties(${src_files} PROPERTIES${some_other_prop}LANGUAGE CXX${other_props})

0 comments on commit a8716a3

Please sign in to comment.