File tree Expand file tree Collapse file tree
ddtrace/internal/datadog/profiling Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,7 +192,12 @@ run_cmake() {
192192 fi
193193 if [[ " ${cmake_args[*]} " =~ " -DBUILD_TESTING=ON " ]]; then
194194 echo " --------------------------------------------------------------------- Running Tests"
195- ctest ${ctest_args[*]} --output-on-failure || { echo " tests failed!" ; exit 1; }
195+ if command -v nproc & > /dev/null; then
196+ NPROC=$( nproc)
197+ else
198+ NPROC=$( getconf _NPROCESSORS_ONLN)
199+ fi
200+ ctest -j${NPROC} ${ctest_args[*]} --output-on-failure || { echo " tests failed!" ; exit 1; }
196201 fi
197202
198203 # OK, the build or whatever went fine I guess.
Original file line number Diff line number Diff line change @@ -33,12 +33,14 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
3333
3434# Since this file is currently only loaded as a subdirectory, we need to propagate certain libdatadog variables up to
3535# the parent scope.
36- set (Datadog_INCLUDE_DIRS
37- ${Datadog_INCLUDE_DIRS}
38- PARENT_SCOPE )
39- set (Datadog_LIBRARIES
40- ${Datadog_LIBRARIES}
41- PARENT_SCOPE )
36+ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
37+ set (Datadog_INCLUDE_DIRS
38+ ${Datadog_INCLUDE_DIRS}
39+ PARENT_SCOPE )
40+ set (Datadog_LIBRARIES
41+ ${Datadog_LIBRARIES}
42+ PARENT_SCOPE )
43+ endif ()
4244
4345set (THREADS_PREFER_PTHREAD_FLAG ON )
4446find_package (Threads REQUIRED )
Original file line number Diff line number Diff line change @@ -60,7 +60,9 @@ function(dd_wrapper_add_test name)
6060 ENVIRONMENT "TSAN_OPTIONS=die_after_fork=0:suppressions=${CMAKE_CURRENT_SOURCE_DIR} /TSan.supp" )
6161
6262 if (LIB_INSTALL_DIR)
63- install (TARGETS ${name} RUNTIME DESTINATION ${LIB_INSTALL_DIR} /../test)
63+ get_filename_component (_test_install_dir "${LIB_INSTALL_DIR} " DIRECTORY )
64+ set (_test_install_dir "${_test_install_dir} /test" )
65+ install (TARGETS ${name} RUNTIME DESTINATION ${_test_install_dir} )
6466 endif ()
6567endfunction ()
6668
You can’t perform that action at this time.
0 commit comments