nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
2index a923cad..53b0f49 100644
3--- a/test/CMakeLists.txt
4+++ b/test/CMakeLists.txt
5@@ -34,13 +34,7 @@ if(DISABLE_COMGR)
6 endif()
7
8 if(NOT APPLE AND BUILD_INTEGRATION_TESTS)
9- # Add nlohmann JSON as an external dependency
10- include(FetchContent)
11- FetchContent_Declare(
12- json
13- GIT_REPOSITORY https://github.com/nlohmann/json.git
14- GIT_TAG v3.11.3)
15- FetchContent_MakeAvailable(json)
16+ find_package(nlohmann_json REQUIRED)
17
18 add_subdirectory(att-tool)
19 endif()
20diff --git a/test/att-tool/CMakeLists.txt b/test/att-tool/CMakeLists.txt
21index 208af16..acd161f 100644
22--- a/test/att-tool/CMakeLists.txt
23+++ b/test/att-tool/CMakeLists.txt
24@@ -1,7 +1,7 @@
25 #
26 # ATT decoder wrapper library for use by the rocprofv3 tool
27 #
28-find_library(COMGR REQUIRED NAMES amd_comgr HINTS /opt/rocm/lib)
29+find_library(COMGR REQUIRED NAMES amd_comgr)
30
31 set(ATT_TOOL_SOURCE_FILES
32 waitcnt/analysis.cpp
33@@ -19,8 +19,11 @@ set(ATT_TOOL_SOURCE_FILES
34
35 set(DECODER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../source/)
36
37-set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ ${DECODER_SRC} ${CMAKE_CURRENT_SOURCE_DIR} ${json_SOURCE_DIR}/include /opt/rocm/include)
38-set(LINK_LIBS ${COMGR} pthread)
39+set(INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ ${DECODER_SRC} ${CMAKE_CURRENT_SOURCE_DIR})
40+find_path(COMGR_INCLUDE_DIR REQUIRED NAMES amd_comgr.h PATH_SUFFIXES amd_comgr)
41+find_path(HSA_INCLUDE_DIR REQUIRED NAMES hsa/amd_hsa_elf.h)
42+set(LINK_LIBS ${COMGR} pthread nlohmann_json::nlohmann_json)
43+list(APPEND INCLUDE_DIRS ${COMGR_INCLUDE_DIR} ${HSA_INCLUDE_DIR})
44
45 # Sources re-globbed only for sanitizer builds
46 file(GLOB ATT_DECODER_V3_FILES
47diff --git a/test/att-tool/sdk/disassembly.hpp b/test/att-tool/sdk/disassembly.hpp
48index c054143..ec3d6d2 100644
49--- a/test/att-tool/sdk/disassembly.hpp
50+++ b/test/att-tool/sdk/disassembly.hpp
51@@ -22,7 +22,7 @@
52
53 #pragma once
54
55-#include <amd_comgr/amd_comgr.h>
56+#include <amd_comgr.h>
57 #include <hsa/amd_hsa_elf.h>
58
59 #include <fcntl.h>
60diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
61index 8adafc0..9501efe 100644
62--- a/test/unit/CMakeLists.txt
63+++ b/test/unit/CMakeLists.txt
64@@ -9,16 +9,7 @@ project(att-decoder-unit-tests LANGUAGES CXX)
65 set(CMAKE_CXX_STANDARD 17)
66 set(CMAKE_CXX_STANDARD_REQUIRED ON)
67
68-# Fetch GoogleTest
69-include(FetchContent)
70-FetchContent_Declare(
71- googletest
72- GIT_REPOSITORY https://github.com/google/googletest.git
73- GIT_TAG v1.14.0)
74-set(INSTALL_GTEST
75- OFF
76- CACHE BOOL "" FORCE)
77-FetchContent_MakeAvailable(googletest)
78+find_package(GTest REQUIRED)
79
80 enable_testing()
81