@@ -137,7 +137,6 @@ if( "spirv-mesa3d-" IN_LIST LIBCLC_TARGETS_TO_BUILD OR "spirv64-mesa3d-" IN_LIST
137
137
endif ()
138
138
endif ()
139
139
140
- set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR} /cmake )
141
140
set ( CMAKE_CLC_COMPILER ${LLVM_CLANG} )
142
141
set ( CMAKE_CLC_ARCHIVE ${LLVM_LINK} )
143
142
set ( CMAKE_LLAsm_PREPROCESSOR ${LLVM_CLANG} )
@@ -258,51 +257,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
258
257
LIB_DIR libspirv
259
258
DIRS ${dirs} ${DARCH} ${DARCH} -${OS} ${DARCH} -${VENDOR}-${OS}
260
259
DEPS convert-spirv.cl convert-core.cl )
261
- # Enumerate SOURCES* files
262
- set ( source_list )
263
- foreach ( l ${dirs} ${DARCH} ${DARCH} -${OS} ${DARCH} -${VENDOR}-${OS} )
264
- foreach ( s "SOURCES" "SOURCES_${LLVM_MAJOR} .${LLVM_MINOR} " )
265
- file ( TO_CMAKE_PATH ${l} /lib/${s} file_loc )
266
- file ( TO_CMAKE_PATH ${CMAKE_SOURCE_DIR} /${file_loc} loc )
267
- # Prepend the location to give higher priority to
268
- # specialized implementation
269
- if ( EXISTS ${loc} )
270
- set ( source_list ${file_loc} ${source_list} )
271
- endif ()
272
- endforeach ()
273
- endforeach ()
274
-
275
- # Add the generated convert.cl here to prevent adding
276
- # the one listed in SOURCES
277
- if ( NOT ${ARCH} STREQUAL "spirv" AND NOT ${ARCH} STREQUAL "spirv64" )
278
- set ( rel_files convert.cl )
279
- set ( objects convert.cl )
280
- if ( NOT ENABLE_RUNTIME_SUBNORMAL )
281
- list ( APPEND rel_files generic/lib/subnormal_use_default.ll )
282
- endif ()
283
- else ()
284
- set ( rel_files )
285
- set ( objects )
286
- endif ()
287
-
288
- foreach ( l ${source_list} )
289
- file ( READ ${l} file_list )
290
- string ( REPLACE "\n " ";" file_list ${file_list} )
291
- get_filename_component ( dir ${l} DIRECTORY )
292
- foreach ( f ${file_list} )
293
- list ( FIND objects ${f} found )
294
- if ( found EQUAL -1 )
295
- list ( APPEND objects ${f} )
296
- list ( APPEND rel_files ${dir} /${f} )
297
- # FIXME: This should really go away
298
- file ( TO_CMAKE_PATH ${CMAKE_SOURCE_DIR} /${dir}/${f} src_loc )
299
- get_filename_component ( fdir ${src_loc} DIRECTORY )
300
-
301
- set_source_files_properties ( ${dir} /${f}
302
- PROPERTIES COMPILE_FLAGS "-I ${fdir} " )
303
- endif ()
304
- endforeach ()
305
- endforeach ()
306
260
307
261
foreach ( d ${${t}_devices} )
308
262
# Some targets don't have a specific GPU to target
@@ -344,95 +298,6 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
344
298
ALIASES ${${d}_aliases}
345
299
GENERATE_TARGET "generate_convert_clc.cl"
346
300
PARENT_TARGET libclc-builtins )
347
- message ( " DEVICE: ${d} ( ${${d} _aliases} )" )
348
-
349
- if ( ${ARCH} STREQUAL "spirv" OR ${ARCH} STREQUAL "spirv64" )
350
- if ( ${ARCH} STREQUAL "spirv" )
351
- set ( t "spir--" )
352
- else ()
353
- set ( t "spir64--" )
354
- endif ()
355
- set ( build_flags -O0 -finline-hint-functions )
356
- set ( opt_flags )
357
- set ( spvflags --spirv-max-version=1.1 )
358
- else ()
359
- set ( build_flags )
360
- set ( opt_flags -O3 )
361
- endif ()
362
-
363
- add_library ( builtins.link.${arch_suffix} STATIC ${rel_files} )
364
- # Make sure we depend on the pseudo target to prevent
365
- # multiple invocations
366
- add_dependencies ( builtins.link.${arch_suffix}
367
- generate_convert.cl )
368
- # CMake will turn this include into absolute path
369
- target_include_directories ( builtins.link.${arch_suffix} PRIVATE
370
- "generic/include" )
371
- target_compile_definitions ( builtins.link.${arch_suffix} PRIVATE
372
- "__CLC_INTERNAL" )
373
- string ( TOUPPER "-DCLC_${ARCH} " CLC_TARGET_DEFINE )
374
- target_compile_definitions ( builtins.link.${arch_suffix} PRIVATE
375
- ${CLC_TARGET_DEFINE} )
376
- target_compile_options ( builtins.link.${arch_suffix} PRIVATE -target
377
- ${t} ${mcpu} -fno-builtin -nostdlib ${build_flags} )
378
- set_target_properties ( builtins.link.${arch_suffix} PROPERTIES
379
- LINKER_LANGUAGE CLC )
380
-
381
- set ( obj_suffix ${arch_suffix} .bc )
382
-
383
- # Add opt target
384
- add_custom_command ( OUTPUT "builtins.opt.${obj_suffix} "
385
- COMMAND ${LLVM_OPT} ${opt_flags} -o
386
- "builtins.opt.${obj_suffix} "
387
- "builtins.link.${obj_suffix} "
388
- DEPENDS "builtins.link.${arch_suffix} " )
389
- add_custom_target ( "opt.${obj_suffix} " ALL
390
- DEPENDS "builtins.opt.${obj_suffix} " )
391
-
392
- if ( ${ARCH} STREQUAL "spirv" OR ${ARCH} STREQUAL "spirv64" )
393
- set ( spv_suffix ${arch_suffix} .spv )
394
- add_custom_command ( OUTPUT "${spv_suffix} "
395
- COMMAND ${LLVM_SPIRV} ${spvflags}
396
- -o "${spv_suffix} "
397
- "builtins.link.${obj_suffix} "
398
- DEPENDS "builtins.link.${arch_suffix} " )
399
- add_custom_target ( "prepare-${spv_suffix} " ALL
400
- DEPENDS "${spv_suffix} " )
401
- install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${spv_suffix}
402
- DESTINATION ${CMAKE_INSTALL_DATADIR} /clc )
403
- else ()
404
-
405
- # Add prepare target
406
- add_custom_command ( OUTPUT "${obj_suffix} "
407
- COMMAND prepare_builtins -o
408
- "${obj_suffix} "
409
- "builtins.opt.${obj_suffix} "
410
- DEPENDS "opt.${obj_suffix} "
411
- "builtins.opt.${obj_suffix} "
412
- prepare_builtins )
413
- add_custom_target ( "prepare-${obj_suffix} " ALL
414
- DEPENDS "${obj_suffix} " )
415
-
416
- # nvptx-- targets don't include workitem builtins
417
- if ( NOT ${t} MATCHES ".*ptx.*--$" )
418
- add_test ( NAME external-calls-${obj_suffix}
419
- COMMAND ./check_external_calls.sh ${CMAKE_CURRENT_BINARY_DIR} /${obj_suffix}
420
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} )
421
- set_tests_properties ( external-calls-${obj_suffix}
422
- PROPERTIES ENVIRONMENT "LLVM_CONFIG=${LLVM_CONFIG} " )
423
- endif ()
424
-
425
- install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${obj_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR} /clc )
426
- foreach ( a ${${d}_aliases} )
427
- set ( alias_suffix "${a} -${t} .bc" )
428
- add_custom_target ( ${alias_suffix} ALL
429
- COMMAND ${CMAKE_COMMAND} -E
430
- create_symlink ${obj_suffix}
431
- ${alias_suffix}
432
- DEPENDS "prepare-${obj_suffix} " )
433
- install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /${alias_suffix} DESTINATION ${CMAKE_INSTALL_DATADIR} /clc )
434
- endforeach ( a )
435
- endif ()
436
301
endforeach ( d )
437
302
endforeach ( t )
438
303
0 commit comments