diff --git a/CMakeLists.txt b/CMakeLists.txt index ba26418fb62..0c2b8357f3f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES - ON + FALSE #FIXME(14541): We've got work to do :( ) if(ENABLE_CCACHE) @@ -258,29 +258,6 @@ if(ENABLE_TRACY) add_link_options(-rdynamic) endif() -add_library(metal_header_directories INTERFACE) -target_include_directories(metal_header_directories INTERFACE ${PROJECT_SOURCE_DIR}/tt_metal/hw/inc) -foreach(lib ${BoostPackages}) - target_include_directories(metal_header_directories INTERFACE ${Boost${lib}_SOURCE_DIR}/include) -endforeach() - -if("$ENV{ARCH_NAME}" STREQUAL "wormhole_b0") - target_include_directories( - metal_header_directories - INTERFACE - tt_metal/hw/inc/wormhole - ${PROJECT_SOURCE_DIR}/tt_metal/hw/inc/wormhole/wormhole_b0_defines - ${UMD_HOME}/device/wormhole - ) -else() - target_include_directories( - metal_header_directories - INTERFACE - ${PROJECT_SOURCE_DIR}/tt_metal/hw/inc/$ENV{ARCH_NAME} - ${UMD_HOME}/device/$ENV{ARCH_NAME} - ) -endif() - if(WITH_PYTHON_BINDINGS) # Can't use the `REUSE_FROM` option bc tt_lib and ttnn have different build flags :( add_library(pch_pybinds INTERFACE) diff --git a/tests/tt_metal/tt_metal/unit_tests_common/CMakeLists.txt b/tests/tt_metal/tt_metal/unit_tests_common/CMakeLists.txt index 808c84e6269..01e44f6ea47 100644 --- a/tests/tt_metal/tt_metal/unit_tests_common/CMakeLists.txt +++ b/tests/tt_metal/tt_metal/unit_tests_common/CMakeLists.txt @@ -34,7 +34,6 @@ TT_ENABLE_UNITY_BUILD(unit_tests_common_o) target_link_libraries( unit_tests_common_o PUBLIC - metal_header_directories gtest gtest_main magic_enum diff --git a/tt_metal/CMakeLists.txt b/tt_metal/CMakeLists.txt index 3005162f25e..cba3743fbc2 100644 --- a/tt_metal/CMakeLists.txt +++ b/tt_metal/CMakeLists.txt @@ -11,7 +11,6 @@ target_sources( target_link_libraries( tt_metal PUBLIC - metal_header_directories Metalium::Metal::Impl Metalium::Metal::STL umd::device diff --git a/tt_metal/common/CMakeLists.txt b/tt_metal/common/CMakeLists.txt index 0219017b4df..db98347e56c 100644 --- a/tt_metal/common/CMakeLists.txt +++ b/tt_metal/common/CMakeLists.txt @@ -7,16 +7,19 @@ set(COMMON_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/work_split.cpp ) -add_library(common OBJECT ${COMMON_SRCS}) +add_library(common STATIC ${COMMON_SRCS}) # FIXME(14541): Should be OBJECT, but can't handle circular deps between Object libs +add_library(Metalium::Metal::Common ALIAS common) + target_link_libraries(common PRIVATE yaml-cpp::yaml-cpp) target_link_libraries( common PUBLIC - metal_header_directories magic_enum fmt::fmt-header-only span Metalium::Metal::STL + Metalium::Metal::LLRT + umd::Firmware ) target_include_directories( diff --git a/tt_metal/hw/CMakeLists.txt b/tt_metal/hw/CMakeLists.txt index 1b16ac15428..6052a6f0f1c 100644 --- a/tt_metal/hw/CMakeLists.txt +++ b/tt_metal/hw/CMakeLists.txt @@ -49,24 +49,9 @@ foreach(ARCH IN LISTS ARCHS) # add output file to the custom target list(APPEND PREPROCESSED_LD_FILES ${HW_OUTPUT_FILE}) - endforeach( - TYPE - IN - LISTS - TYPES - ) - endforeach( - PROC - IN - LISTS - PORCS - ) -endforeach( - ARCH - IN - LISTS - ARCHS -) + endforeach() + endforeach() +endforeach() # Function appends b0 if its wormhole function(get_alias INPUT_STRING OUTPUT_VAR) @@ -193,18 +178,8 @@ foreach(ARCH IN LISTS ARCHS) VERBATIM ) list(APPEND PREPROCESSED_O_FILES ${HW_OUTPUT_FILE}) - endforeach( - HWLIB - IN - LISTS - HWLIBS - ) -endforeach( - ARCH - IN - LISTS - ARCHS -) + endforeach() +endforeach() # custom target that depends on all the output files add_custom_target( @@ -214,3 +189,16 @@ add_custom_target( ${PREPROCESSED_LD_FILES} ${PREPROCESSED_O_FILES} ) + +add_library(hw INTERFACE) +add_library(Metalium::Metal::Hardware ALIAS hw) + +set(currentArch "$ENV{ARCH_NAME}") +string(REPLACE "wormhole_b0" "wormhole" currentArch "${currentArch}") +target_include_directories( + hw + INTERFACE + inc + inc/${currentArch} + $<$:${CMAKE_CURRENT_SOURCE_DIR}/inc/wormhole/wormhole_b0_defines> +) diff --git a/tt_metal/impl/CMakeLists.txt b/tt_metal/impl/CMakeLists.txt index 758712bef66..1897305eb79 100644 --- a/tt_metal/impl/CMakeLists.txt +++ b/tt_metal/impl/CMakeLists.txt @@ -29,11 +29,13 @@ add_library(Metalium::Metal::Impl ALIAS impl) target_link_libraries( impl + PUBLIC + common + Metalium::Metal::LLRT PRIVATE Boost::smart_ptr range-v3::range-v3 ) -target_link_libraries(impl PUBLIC common) target_include_directories( impl diff --git a/tt_metal/llrt/CMakeLists.txt b/tt_metal/llrt/CMakeLists.txt index 4050722542a..68a69ec5654 100644 --- a/tt_metal/llrt/CMakeLists.txt +++ b/tt_metal/llrt/CMakeLists.txt @@ -17,11 +17,14 @@ set(LLRT_SRC ${CMAKE_CURRENT_SOURCE_DIR}/blackhole/bh_hal_idle_eth.cpp ) -add_library(llrt OBJECT ${LLRT_SRC}) +add_library(llrt STATIC ${LLRT_SRC}) # FIXME(14541): Should be OBJECT, but can't handle circular deps between Object libs +add_library(Metalium::Metal::LLRT ALIAS llrt) + target_link_libraries( llrt PUBLIC - common + Metalium::Metal::Common umd::device + Metalium::Metal::Hardware ) target_compile_options(llrt PRIVATE -Wno-int-to-pointer-cast) diff --git a/ttnn/CMakeLists.txt b/ttnn/CMakeLists.txt index 1124375431c..bc2b1773cc2 100644 --- a/ttnn/CMakeLists.txt +++ b/ttnn/CMakeLists.txt @@ -591,7 +591,6 @@ set(TTNN_PUBLIC_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/cpp ) set(TTNN_PUBLIC_LINK_LIBRARIES - metal_header_directories metal_common_libs Metalium::Metal Boost::container