Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
a694fecb
"benchmark/vscode:/vscode.git/clone" did not exist on "cbedd1db1d8bdde867efadf90b3c801dfe4e9964"
Commit
a694fecb
authored
Jun 18, 2023
by
Artur Wojcik
Browse files
cmake: use IMPORTED target for thread library of the system
parent
5d91adcf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
9 deletions
+2
-9
CMakeLists.txt
CMakeLists.txt
+1
-0
src/CMakeLists.txt
src/CMakeLists.txt
+0
-2
test/CMakeLists.txt
test/CMakeLists.txt
+1
-7
No files found.
CMakeLists.txt
View file @
a694fecb
...
...
@@ -51,6 +51,7 @@ project(migraphx LANGUAGES C CXX)
include
(
CTest
)
find_package
(
ROCM REQUIRED
)
find_package
(
Threads REQUIRED
)
find_path
(
HALF_INCLUDE_DIR half.hpp PATH_SUFFIXES half
)
if
(
NOT HALF_INCLUDE_DIR
)
...
...
src/CMakeLists.txt
View file @
a694fecb
...
...
@@ -248,8 +248,6 @@ endif()
target_link_libraries
(
migraphx PRIVATE -ldl
)
target_include_directories
(
migraphx SYSTEM PUBLIC $<BUILD_INTERFACE:
${
HALF_INCLUDE_DIR
}
>
)
find_package
(
Threads
)
target_link_libraries
(
migraphx PUBLIC Threads::Threads
)
find_package
(
nlohmann_json 3.8.0 REQUIRED
)
...
...
test/CMakeLists.txt
View file @
a694fecb
...
...
@@ -98,17 +98,11 @@ endfunction()
function
(
add_test_executable TEST_NAME
)
add_executable
(
${
TEST_NAME
}
EXCLUDE_FROM_ALL
${
ARGN
}
)
target_link_libraries
(
${
TEST_NAME
}
${
CMAKE_THREAD_LIBS_INIT
}
)
# Cmake does not add flags correctly for gcc
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"GNU"
)
set_target_properties
(
${
TEST_NAME
}
PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread
)
endif
()
set
(
TEST_COMMAND
${
TEST_NAME
}
)
add_test_command
(
${
TEST_NAME
}
${
TEST_COMMAND
}
)
add_dependencies
(
tests
${
TEST_NAME
}
)
add_dependencies
(
check
${
TEST_NAME
}
)
target_link_libraries
(
${
TEST_NAME
}
migraphx migraphx_onnx migraphx_ref
)
target_link_libraries
(
${
TEST_NAME
}
Threads::Threads
migraphx migraphx_onnx migraphx_ref
)
target_include_directories
(
${
TEST_NAME
}
PUBLIC include
)
endfunction
(
add_test_executable
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment