Skip to content

Commit 3c91cf9

Browse files
authored
[libclc] Don't run remangler on OpenCL library (#18697)
The remangler is for libspirv. Don't run remangler on OpenCL library until there is a use case. This would avoids confusions on unused remangled OpenCL library in build folder.
1 parent 87da156 commit 3c91cf9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

libclc/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
586586
ARCH_SUFFIX libspirv-${arch_suffix}
587587
TRIPLE ${clang_triple}
588588
TARGET_ENV libspirv-
589+
REMANGLE ${LIBCLC_GENERATE_REMANGLED_VARIANTS}
589590
COMPILE_FLAGS ${spirv_build_flags}
590591
OPT_FLAGS ${opt_flags}
591592
LIB_FILES ${libspirv_lib_files}

libclc/cmake/modules/AddLibclc.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ endfunction()
309309
# Optimization options (for opt)
310310
# * TARGET_ENV <string>
311311
# Prefix to give the final builtin library aliases
312+
# * REMANGLE <string>
313+
# Bool string indicating whether remangler will be run
312314
# * ALIASES <string> ...
313315
# List of aliases
314316
# * INTERNAL_LINK_DEPENDENCIES <target> ...
@@ -318,7 +320,7 @@ endfunction()
318320
function(add_libclc_builtin_set)
319321
cmake_parse_arguments(ARG
320322
"CLC_INTERNAL"
321-
"ARCH;TRIPLE;ARCH_SUFFIX;TARGET_ENV;PARENT_TARGET"
323+
"ARCH;TRIPLE;ARCH_SUFFIX;TARGET_ENV;REMANGLE;PARENT_TARGET"
322324
"LIB_FILES;GEN_FILES;COMPILE_FLAGS;OPT_FLAGS;ALIASES;INTERNAL_LINK_DEPENDENCIES"
323325
${ARGN}
324326
)
@@ -483,7 +485,7 @@ function(add_libclc_builtin_set)
483485
install( FILES ${builtins_lib} DESTINATION ${CMAKE_INSTALL_DATADIR}/clc )
484486

485487
# Generate remangled variants if requested
486-
if( LIBCLC_GENERATE_REMANGLED_VARIANTS )
488+
if( ARG_REMANGLE )
487489
set( dummy_in ${LIBCLC_LIBRARY_OUTPUT_INTDIR}/libclc_dummy_in.cc )
488490
add_custom_command( OUTPUT ${dummy_in}
489491
COMMAND ${CMAKE_COMMAND} -E make_directory ${LIBCLC_LIBRARY_OUTPUT_INTDIR}

0 commit comments

Comments
 (0)