Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 2cecdec

Browse files
Merge pull request #1132 from igchor/fix_atomic
tests: link atomic to all tests
2 parents ac1f733 + ea65a8e commit 2cecdec

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Up-to-date support/maintenance status of branches/releases is available on [pmem
2626
- valgrind-devel (at best with [pmemcheck support](https://github.com/pmem/valgrind))
2727
- clang format 9.0
2828
- perl
29+
- libatomic
2930

3031
## On Linux ##
3132

tests/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: BSD-3-Clause
2-
# Copyright 2018-2020, Intel Corporation
2+
# Copyright 2018-2021, Intel Corporation
33

44
include(ctest_helpers.cmake)
55

@@ -252,10 +252,10 @@ if (TEST_SELF_RELATIVE_POINTER)
252252
build_test(self_relative_ptr_arith ptr_arith/self_relative_ptr_arith.cpp)
253253
add_test_generic(NAME self_relative_ptr_arith TRACERS none memcheck pmemcheck)
254254

255-
build_test_atomic(self_relative_ptr_atomic self_relative_ptr_atomic/self_relative_ptr_atomic.cpp)
255+
build_test(self_relative_ptr_atomic self_relative_ptr_atomic/self_relative_ptr_atomic.cpp)
256256
add_test_generic(NAME self_relative_ptr_atomic TRACERS none memcheck drd helgrind)
257257

258-
build_test_atomic(self_relative_ptr_atomic_pmem self_relative_ptr_atomic/self_relative_ptr_atomic_pmem.cpp)
258+
build_test(self_relative_ptr_atomic_pmem self_relative_ptr_atomic/self_relative_ptr_atomic_pmem.cpp)
259259
add_test_generic(NAME self_relative_ptr_atomic_pmem TRACERS none memcheck pmemcheck drd helgrind)
260260
endif()
261261

tests/ctest_helpers.cmake

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: BSD-3-Clause
2-
# Copyright 2018-2020, Intel Corporation
2+
# Copyright 2018-2021, Intel Corporation
33

44
#
55
# ctest_helpers.cmake - helper functions for tests/CMakeLists.txt
@@ -109,6 +109,8 @@ function(build_test name)
109109
endif()
110110
if(WIN32)
111111
target_link_libraries(${name} dbghelp)
112+
else()
113+
target_link_libraries(${name} atomic)
112114
endif()
113115
target_compile_definitions(${name} PRIVATE TESTS_LIBPMEMOBJ_VERSION=0x${LIBPMEMOBJ_VERSION_NUM})
114116

@@ -130,14 +132,6 @@ function(build_test_tbb name)
130132
target_link_libraries(${name} ${TBB_LIBRARIES})
131133
endfunction()
132134

133-
# Function to build test with atomic
134-
function(build_test_atomic name)
135-
build_test(${name} ${ARGN})
136-
if(CLANG)
137-
target_link_libraries(${name} atomic)
138-
endif()
139-
endfunction()
140-
141135
# Function to build a TBB test with mocked pmemobj_defrag() function
142136
function(build_test_tbb_defrag name)
143137
build_test_tbb(${name} ${ARGN})

0 commit comments

Comments
 (0)