Fichiers
rocm-systems/external/CMakeLists.txt
T
Jonathan R. Madsen 351d825a8d Initial skeleton (revised) (#16)
* [0/N] git submodules

* [1/N] Update cmake, gitignore, external

- clang-tidy file
- update .gitignore
- update main CMakeLists.txt
- update external/CMakeLists.txt
- update rocprofiler_config_interfaces.cmake
- update rocprofiler_formatting.cmake
- update rocprofiler_interfaces.cmake
- update rocprofiler_linting.cmake
- update rocprofiler_options.cmake
- update rocprofiler_utilities.cmake

* [2/N] Update rocprofiler/config.h

- update to work with new rocprofiler.h

* [3/N] Update source/lib/rocprofiler/hsa

- hsa-types.h: static asserts
- hsa.cpp: copyTables scope
- hsa.gen.cpp: ACTIVITY_DOMAIN_HSA_API -> ROCPROFILER_TRACER_ACTIVITY_DOMAIN_HSA_API
- rename some files
- add rocprofiler_ prefix to types and enums
- HSA_API_TABLE_LOOKUP_DEFINITION macro
- get_saved_table() -> get_table()

* [4/N] Update source/lib/common

- CMake: change target_link_libraries
- defines.hpp: remove ppdefs defined in include/rocprofiler/defines.h

* [5/N] Update source/lib/rocprofiler

- updates due to changes in rocprofiler.h
- rocprofiler_config.cpp: remove unions which are now defined in include/rocprofiler
- CMakeLists.txt: rocprofiler.cpp and public hsa-runtime and hip libraries
- rocprofiler.cpp: dummy implementations for:
  - rocprofiler_query_available_agents
  - rocprofiler_create_context
  - rocprofiler_start_context
  - rocprofiler_stop_context
  - rocprofiler_flush_buffer
  - rocprofiler_destroy_buffer

* [6/N] Update license

- replace stale LBNL license

* [7/N] CMake format
2023-08-22 13:29:11 -05:00

81 lignes
2.5 KiB
CMake

#
#
# External dependencies
#
#
set(BUILD_TESTING OFF)
if(ROCPROFILER_BUILD_TESTS)
if(ROCPROFILER_BUILD_GTEST)
set(INSTALL_GTEST
OFF
CACHE BOOL "")
set(BUILD_GMOCK
OFF
CACHE BOOL "")
add_subdirectory(googletest EXCLUDE_FROM_ALL)
if(NOT TARGET GTest::gtest)
message(FATAL_ERROR "missing GTest::gtest")
endif()
target_link_libraries(rocprofiler-gtest INTERFACE GTest::gtest)
target_include_directories(
rocprofiler-gtest SYSTEM
INTERFACE ${CMAKE_CURRENT_LIST_DIR}/googletest/googletest/include)
mark_as_advanced(INSTALL_GTEST)
mark_as_advanced(BUILD_GMOCK)
mark_as_advanced(GTEST_HAS_ABSL)
else()
find_package(GTest REQUIRED)
target_link_libraries(rocprofiler-gtest INTERFACE GTest::gtest)
endif()
endif()
if(ROCPROFILER_BUILD_GLOG)
# checkout submodule if not already checked out or clone repo if no .gitmodules file
rocprofiler_checkout_git_submodule(
RECURSIVE
RELATIVE_PATH external/glog
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/google/glog.git
REPO_BRANCH "master")
# May want to use GFLAGS in the future
set(WITH_GFLAGS OFF)
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(glog EXCLUDE_FROM_ALL)
target_link_libraries(rocprofiler-glog INTERFACE $<BUILD_INTERFACE:glog::glog>)
target_include_directories(
rocprofiler-glog SYSTEM
INTERFACE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/external/glog>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/glog/src>)
else()
find_package(glog REQUIRED)
target_link_libraries(rocprofiler-glog INTERFACE glog::glog)
endif()
if(ROCPROFILER_BUILD_FMT)
# checkout submodule if not already checked out or clone repo if no .gitmodules file
rocprofiler_checkout_git_submodule(
RECURSIVE
RELATIVE_PATH external/fmt
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://github.com/fmtlib/fmt.git
REPO_BRANCH "master")
set(FMT_TEST OFF)
add_subdirectory(fmt EXCLUDE_FROM_ALL)
target_link_libraries(rocprofiler-fmt INTERFACE $<BUILD_INTERFACE:fmt::fmt>)
target_include_directories(
rocprofiler-fmt SYSTEM
INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/external/fmt/include>)
else()
find_package(fmt REQUIRED)
target_link_libraries(rocprofiler-fmt INTERFACE fmt::fmt)
endif()