diff --git a/CMakeLists.txt b/CMakeLists.txt index b1bd3610a..2d6c0e18f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -458,9 +458,11 @@ endif() # Add subdirectories in dependency DAG order (which happens to be semi-alpha: # don't be fooled). -add_subdirectory(third-party) +add_subdirectory(third-party/sysdeps) +add_subdirectory(third-party/googletest) # TODO: decide on if this should be a sysdep or not (both?) add_subdirectory(base) add_subdirectory(compiler) +add_subdirectory(third-party) add_subdirectory(core) # Note that rocprofiler-register is in base and is what higher level clients # depend on. The profiler itself is independent. diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 36ff6aed4..1cb3e92ab 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -1,11 +1,24 @@ +# Subdirectory load order here is carefully balanced - see usage from the root +# CMakeLists.txt. Notably this file does *not* include the sysdeps subdirectory, +# which is expected to be included *first*. This allows for bootstrapping +# compiler/, so other projects in this directory can use the amd-llvm compiler +# toolchain if they so wish (most should eventually). + add_custom_target(therock-third-party) +# googletest is currently included explicitly ahead of the rest of this folder +# by the base CMakeLists.txt since since amdsmi in base/ depends on it and +# base/ is included before compiler/. To resolve that, we may want to move +# amdsmi from base/ to core/, after which we can turn googletest back into a +# typical third-party package. +# add_subdirectory(googletest) +add_dependencies(therock-third-party therock-googletest) + # No-dep third party libraries (alphabetical) add_subdirectory(boost) add_subdirectory(eigen) add_subdirectory(flatbuffers) add_subdirectory(fmt) -add_subdirectory(googletest) add_subdirectory(libdivide) add_subdirectory(msgpack-cxx) add_subdirectory(nlohmann-json) @@ -27,12 +40,3 @@ endif() if(THEROCK_ENABLE_HOST_SUITE_SPARSE) add_subdirectory(SuiteSparse) endif() - -# TODO: Relocate non header-only libraries here (i.e. boost, host-blas). -if(THEROCK_BUNDLE_SYSDEPS) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - add_subdirectory(sysdeps/linux) - elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") - add_subdirectory(sysdeps/windows) - endif() -endif() diff --git a/third-party/googletest/CMakeLists.txt b/third-party/googletest/CMakeLists.txt index 4058c8662..bea8efa52 100644 --- a/third-party/googletest/CMakeLists.txt +++ b/third-party/googletest/CMakeLists.txt @@ -16,5 +16,3 @@ therock_cmake_subproject_declare(therock-googletest ) therock_cmake_subproject_provide_package(therock-googletest GTest lib/cmake/GTest) therock_cmake_subproject_activate(therock-googletest) - -add_dependencies(therock-third-party therock-googletest) diff --git a/third-party/spdlog/CMakeLists.txt b/third-party/spdlog/CMakeLists.txt index 71978cb26..05d0e2add 100644 --- a/third-party/spdlog/CMakeLists.txt +++ b/third-party/spdlog/CMakeLists.txt @@ -11,6 +11,8 @@ therock_cmake_subproject_declare(therock-spdlog NO_MERGE_COMPILE_COMMANDS OUTPUT_ON_FAILURE EXTERNAL_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/source" + COMPILER_TOOLCHAIN + amd-llvm BUILD_DEPS therock-fmt CMAKE_ARGS diff --git a/third-party/sysdeps/CMakeLists.txt b/third-party/sysdeps/CMakeLists.txt new file mode 100644 index 000000000..4076569ab --- /dev/null +++ b/third-party/sysdeps/CMakeLists.txt @@ -0,0 +1,8 @@ +# TODO: Relocate non header-only libraries here (i.e. boost, host-blas). +if(THEROCK_BUNDLE_SYSDEPS) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_subdirectory(linux) + elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") + add_subdirectory(windows) + endif() +endif()