Skip to content

Commit

Permalink
Fix ch 14, r 4 for TC pass
Browse files Browse the repository at this point in the history
1. Symlink where possible
2. Use TARGET_FILE for tests
  • Loading branch information
robertodr committed Aug 9, 2018
1 parent 6f633bc commit 82d4461
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
4 changes: 0 additions & 4 deletions chapter-14/recipe-02/cxx-example/CTestConfig.cmake

This file was deleted.

1 change: 1 addition & 0 deletions chapter-14/recipe-02/cxx-example/CTestConfig.cmake
4 changes: 0 additions & 4 deletions chapter-14/recipe-03/cxx-example/CTestConfig.cmake

This file was deleted.

1 change: 1 addition & 0 deletions chapter-14/recipe-03/cxx-example/CTestConfig.cmake
2 changes: 1 addition & 1 deletion chapter-14/recipe-03/fortran-example/CTestConfig.cmake
12 changes: 5 additions & 7 deletions chapter-14/recipe-04/cxx-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ find_package(Threads REQUIRED)

add_executable(example example.cpp)

target_link_libraries(
example
target_link_libraries(example
PUBLIC
Threads::Threads
)
Expand All @@ -22,13 +21,12 @@ option(ENABLE_TSAN "Enable ThreadSanitizer" OFF)

if(ENABLE_TSAN)
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
target_compile_options(
example
message(STATUS "ThreadSanitizer enabled")
target_compile_options(example
PUBLIC
-g -O1 -fsanitize=thread -fno-omit-frame-pointer -fPIC
)
target_link_libraries(
example
target_link_libraries(example
PUBLIC
tsan
)
Expand All @@ -46,5 +44,5 @@ add_test(
NAME
example
COMMAND
${PROJECT_BINARY_DIR}/example
$<TARGET_FILE:example>
)
4 changes: 0 additions & 4 deletions chapter-14/recipe-04/cxx-example/CTestConfig.cmake

This file was deleted.

1 change: 1 addition & 0 deletions chapter-14/recipe-04/cxx-example/CTestConfig.cmake
3 changes: 2 additions & 1 deletion chapter-14/recipe-04/cxx-example/dashboard.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
set(CTEST_PROJECT_NAME "example")
set(CTEST_SITE "localhost")
cmake_host_system_information(RESULT _site QUERY HOSTNAME)
set(CTEST_SITE ${_site})
set(CTEST_BUILD_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}")

set(CTEST_SOURCE_DIRECTORY "${CTEST_SCRIPT_DIRECTORY}")
Expand Down

0 comments on commit 82d4461

Please sign in to comment.