From cbe6b6f5351215379aaeb73597b948e707350d5b Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Tue, 13 Feb 2024 11:24:09 +0000 Subject: [PATCH] Prefix compiler libs with ock- This prefixes some of the compiler libs (those under utils and vecz) with ock- to distinguish against llvm libraries if we are included from llvm. --- .../compiler/refsi_g1_wi/CMakeLists.txt | 4 ++-- .../refsi_m1/compiler/refsi_m1/CMakeLists.txt | 4 ++-- .../CMakeLists.txt | 4 ++-- modules/compiler/source/base/CMakeLists.txt | 2 +- modules/compiler/spirv-ll/CMakeLists.txt | 2 +- modules/compiler/test/CMakeLists.txt | 2 +- modules/compiler/utils/CMakeLists.txt | 20 +++++++++---------- modules/compiler/vecz/CMakeLists.txt | 18 ++++++++--------- modules/compiler/vecz/tools/CMakeLists.txt | 2 +- .../CMakeLists.txt | 4 ++-- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/refsi/refsi_g1_wi/compiler/refsi_g1_wi/CMakeLists.txt b/examples/refsi/refsi_g1_wi/compiler/refsi_g1_wi/CMakeLists.txt index 71ab0bcfc..3dcfd6e47 100644 --- a/examples/refsi/refsi_g1_wi/compiler/refsi_g1_wi/CMakeLists.txt +++ b/examples/refsi/refsi_g1_wi/compiler/refsi_g1_wi/CMakeLists.txt @@ -50,8 +50,8 @@ if(CA_RUNTIME_COMPILER_ENABLED) target_link_libraries(compiler-refsi-g1-wi PUBLIC compiler-riscv-utils - compiler-pipeline - compiler-binary-metadata + ock-compiler-pipeline + ock-compiler-binary-metadata compiler-linker-utils refsidrv compiler-base diff --git a/examples/refsi/refsi_m1/compiler/refsi_m1/CMakeLists.txt b/examples/refsi/refsi_m1/compiler/refsi_m1/CMakeLists.txt index 2528b9550..e54efb38d 100644 --- a/examples/refsi/refsi_m1/compiler/refsi_m1/CMakeLists.txt +++ b/examples/refsi/refsi_m1/compiler/refsi_m1/CMakeLists.txt @@ -50,8 +50,8 @@ if(CA_RUNTIME_COMPILER_ENABLED) target_link_libraries(compiler-refsi-m1 PUBLIC compiler-riscv-utils - compiler-pipeline - compiler-binary-metadata + ock-compiler-pipeline + ock-compiler-binary-metadata compiler-linker-utils refsidrv compiler-base diff --git a/modules/compiler/cookie/{{cookiecutter.target_name}}/CMakeLists.txt b/modules/compiler/cookie/{{cookiecutter.target_name}}/CMakeLists.txt index 8778aa976..6384e558a 100644 --- a/modules/compiler/cookie/{{cookiecutter.target_name}}/CMakeLists.txt +++ b/modules/compiler/cookie/{{cookiecutter.target_name}}/CMakeLists.txt @@ -59,8 +59,8 @@ endif() target_link_libraries(compiler-{{cookiecutter.target_name}} PUBLIC compiler-base utils - compiler-pipeline - compiler-binary-metadata + ock-compiler-pipeline + ock-compiler-binary-metadata compiler-linker-utils LLVMCoverage LLVMDebugInfoCodeView LLVMExecutionEngine LLVMVectorize LLVMipo multi_llvm) diff --git a/modules/compiler/source/base/CMakeLists.txt b/modules/compiler/source/base/CMakeLists.txt index 0cb7aecaa..fbadd157f 100644 --- a/modules/compiler/source/base/CMakeLists.txt +++ b/modules/compiler/source/base/CMakeLists.txt @@ -91,7 +91,7 @@ list(TRANSFORM CLANG_LIBS APPEND "${CMAKE_STATIC_LIBRARY_SUFFIX}") target_link_libraries(compiler-base PUBLIC - builtins cargo mux spirv-ll compiler-pipeline compiler-binary-metadata vecz + builtins cargo mux spirv-ll ock-compiler-pipeline ock-compiler-binary-metadata ock-vecz "${CLANG_LIBS}" # Link against version (for clang) on Windows. $<$:version> diff --git a/modules/compiler/spirv-ll/CMakeLists.txt b/modules/compiler/spirv-ll/CMakeLists.txt index aa7c90fa6..5f85f4e05 100644 --- a/modules/compiler/spirv-ll/CMakeLists.txt +++ b/modules/compiler/spirv-ll/CMakeLists.txt @@ -69,7 +69,7 @@ target_include_directories(spirv-ll PUBLIC $) target_include_directories(spirv-ll SYSTEM PUBLIC ${spirv-headers_SOURCE_DIR}/include) -target_link_libraries(spirv-ll PUBLIC cargo multi_llvm compiler-pipeline LLVMCore LLVMBitWriter) +target_link_libraries(spirv-ll PUBLIC cargo multi_llvm ock-compiler-pipeline LLVMCore LLVMBitWriter) add_subdirectory(tools) if(CA_ENABLE_TESTS) diff --git a/modules/compiler/test/CMakeLists.txt b/modules/compiler/test/CMakeLists.txt index 4bf3a040c..23c795561 100644 --- a/modules/compiler/test/CMakeLists.txt +++ b/modules/compiler/test/CMakeLists.txt @@ -31,7 +31,7 @@ target_include_directories(UnitCompiler PRIVATE $) target_link_libraries(UnitCompiler PRIVATE cargo - compiler-static mux ca_gtest_main compiler-base compiler-pipeline compiler-binary-metadata) + compiler-static mux ca_gtest_main compiler-base ock-compiler-pipeline ock-compiler-binary-metadata) target_resources(UnitCompiler NAMESPACES ${BUILTINS_NAMESPACES}) diff --git a/modules/compiler/utils/CMakeLists.txt b/modules/compiler/utils/CMakeLists.txt index c502d860f..3e87adc02 100644 --- a/modules/compiler/utils/CMakeLists.txt +++ b/modules/compiler/utils/CMakeLists.txt @@ -14,7 +14,7 @@ # # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -add_ca_library(compiler-pipeline STATIC +add_ca_library(ock-compiler-pipeline STATIC ${CMAKE_CURRENT_SOURCE_DIR}/include/compiler/utils/StructTypeRemapper.h ${CMAKE_CURRENT_SOURCE_DIR}/include/compiler/utils/add_kernel_wrapper_pass.h ${CMAKE_CURRENT_SOURCE_DIR}/include/compiler/utils/add_scheduling_parameters_pass.h @@ -117,43 +117,43 @@ add_ca_library(compiler-pipeline STATIC ${CMAKE_CURRENT_SOURCE_DIR}/source/verify_reqd_sub_group_size_pass.cpp ${CMAKE_CURRENT_SOURCE_DIR}/source/work_item_loops_pass.cpp) -target_include_directories(compiler-pipeline PUBLIC +target_include_directories(ock-compiler-pipeline PUBLIC $) -target_compile_definitions(compiler-pipeline PRIVATE +target_compile_definitions(ock-compiler-pipeline PRIVATE $<$:CA_PLATFORM_LINUX> $<$:CA_PLATFORM_WINDOWS> $<$:CA_PLATFORM_MAC> $<$:CA_PLATFORM_ANDROID> $<$:CA_PLATFORM_QNX>) -target_link_libraries(compiler-pipeline PUBLIC +target_link_libraries(ock-compiler-pipeline PUBLIC multi_llvm LLVMPasses LLVMTransformUtils) if(TARGET LLVMCore) - target_link_libraries(compiler-pipeline PUBLIC LLVMCore) + target_link_libraries(ock-compiler-pipeline PUBLIC LLVMCore) endif() -add_ca_library(compiler-binary-metadata STATIC +add_ca_library(ock-compiler-binary-metadata STATIC ${CMAKE_CURRENT_SOURCE_DIR}/include/compiler/utils/add_metadata_pass.h ${CMAKE_CURRENT_SOURCE_DIR}/include/compiler/utils/metadata_analysis.h ${CMAKE_CURRENT_SOURCE_DIR}/include/compiler/utils/metadata_hooks.h ${CMAKE_CURRENT_SOURCE_DIR}/source/metadata_analysis.cpp ${CMAKE_CURRENT_SOURCE_DIR}/source/metadata_hooks.cpp) -target_include_directories(compiler-binary-metadata PUBLIC +target_include_directories(ock-compiler-binary-metadata PUBLIC $) -target_compile_definitions(compiler-binary-metadata PRIVATE +target_compile_definitions(ock-compiler-binary-metadata PRIVATE $<$:CA_PLATFORM_LINUX> $<$:CA_PLATFORM_WINDOWS> $<$:CA_PLATFORM_MAC> $<$:CA_PLATFORM_ANDROID> $<$:CA_PLATFORM_QNX>) -target_link_libraries(compiler-binary-metadata PUBLIC +target_link_libraries(ock-compiler-binary-metadata PUBLIC md_handler multi_llvm LLVMPasses LLVMTransformUtils) if(TARGET LLVMCore) - target_link_libraries(compiler-binary-metadata PUBLIC LLVMCore) + target_link_libraries(ock-compiler-binary-metadata PUBLIC LLVMCore) endif() diff --git a/modules/compiler/vecz/CMakeLists.txt b/modules/compiler/vecz/CMakeLists.txt index 6b18a76f8..065084f8c 100644 --- a/modules/compiler/vecz/CMakeLists.txt +++ b/modules/compiler/vecz/CMakeLists.txt @@ -167,32 +167,32 @@ endif() if(CA_VECZ_ONLY) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - add_llvm_loadable_module(vecz ${COMMON_SRCS}) + add_llvm_loadable_module(ock-vecz ${COMMON_SRCS}) else() - add_llvm_library(vecz ${COMMON_SRCS}) + add_llvm_library(ock-vecz ${COMMON_SRCS}) endif() else() # We want a static library for linking with libOpenCL - add_ca_library(vecz STATIC ${MODULES_LIBRARY_TYPE} ${COMMON_SRCS}) + add_ca_library(ock-vecz STATIC ${MODULES_LIBRARY_TYPE} ${COMMON_SRCS}) llvm_map_components_to_libnames(LLVM_LIBS support core analysis instcombine transformutils scalaropts ipo passes) endif() -target_include_directories(vecz +target_include_directories(ock-vecz PUBLIC $ PRIVATE $) -target_compile_options(vecz PRIVATE ${VECZ_COMPILE_OPTIONS}) -target_compile_definitions(vecz PRIVATE +target_compile_options(ock-vecz PRIVATE ${VECZ_COMPILE_OPTIONS}) +target_compile_definitions(ock-vecz PRIVATE ${VECZ_COMPILE_DEFINITIONS}) -target_link_libraries(vecz PRIVATE compiler-pipeline multi_llvm PUBLIC ${LLVM_LIBS}) +target_link_libraries(ock-vecz PRIVATE ock-compiler-pipeline multi_llvm PUBLIC ${LLVM_LIBS}) # intrinsics_gen uses tablegen to generate Attributes.inc, which is # (recursively) included by 'llvm/IR/Module.h', therefore this module depends # on that target. if(TARGET intrinsics_gen) - add_dependencies(vecz intrinsics_gen) + add_dependencies(ock-vecz intrinsics_gen) endif() if(NOT CA_VECZ_ONLY) @@ -203,6 +203,6 @@ if(NOT CA_VECZ_ONLY) endif() # Append to the list of module libraries, the cache MUST be updated. -list(APPEND MODULES_LIBRARIES vecz) +list(APPEND MODULES_LIBRARIES ock-vecz) set(MODULES_LIBRARIES ${MODULES_LIBRARIES} CACHE INTERNAL "List of module libraries.") diff --git a/modules/compiler/vecz/tools/CMakeLists.txt b/modules/compiler/vecz/tools/CMakeLists.txt index 3a6fb04ee..00082a3b6 100644 --- a/modules/compiler/vecz/tools/CMakeLists.txt +++ b/modules/compiler/vecz/tools/CMakeLists.txt @@ -23,5 +23,5 @@ llvm_map_components_to_libnames(llvm_libs all ${LLVM_TARGETS_TO_BUILD}) # LLVM 8 adds these invalid libraries to the list, remove them to avoid # attempting to link against LTO-NOTFOUND and OptRemarks-NOTFOUND. list(REMOVE_ITEM llvm_libs LTO OptRemarks) -target_link_libraries(veczc PUBLIC vecz multi_llvm compiler-pipeline ${llvm_libs}) +target_link_libraries(veczc PUBLIC ock-vecz multi_llvm ock-compiler-pipeline ${llvm_libs}) install(TARGETS veczc RUNTIME DESTINATION bin COMPONENT VECZ) diff --git a/modules/mux/cookie/{{cookiecutter.target_name}}/CMakeLists.txt b/modules/mux/cookie/{{cookiecutter.target_name}}/CMakeLists.txt index 6d0a1854a..acc121898 100644 --- a/modules/mux/cookie/{{cookiecutter.target_name}}/CMakeLists.txt +++ b/modules/mux/cookie/{{cookiecutter.target_name}}/CMakeLists.txt @@ -130,8 +130,8 @@ target_link_libraries({{cookiecutter.target_name}} PUBLIC cargo tracer - compiler-pipeline - compiler-binary-metadata + ock-compiler-pipeline + ock-compiler-binary-metadata utils ) target_link_libraries({{cookiecutter.target_name}} PUBLIC loader)