Skip to content

Commit

Permalink
update pch header to match flags for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed Nov 26, 2024
1 parent c05ff0b commit 627505a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ pipeline {
unstash 'MathSetup'
if (!(params.optimizeUnitTests || isBranch('develop') || isBranch('master'))) {
sh "echo O=1 >> make/local"
}
sh'''
} sh'''
CXX=${CLANG_CXX} CC=${CLANG_CC} cmake -S . -B \"build\" -DCMAKE_BUILD_TYPE=RELEASE -DSTAN_OPENCL=ON -DSTAN_OPENCL_PLATFORM_ID=${OPENCL_PLATFORM_ID_GPU} -DSTAN_OPENCL_DEVICE_ID=${OPENCL_DEVICE_ID_GPU} && \
cd build && make -j${PARALLEL} test_unit_math_opencl_tests && ctest --output-on-failure --label-regex unit_math_opencl
'''
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function(add_gtest_grouped_test test_directory folder_test_name target_pch)
string(REPLACE ".cpp" "" SUB_TEST_TARGET_NAME ${TMP_TEST_TARGET_NAME})
list(APPEND ALL_SUB_TEST_TARGETS ${SUB_TEST_TARGET_NAME})
add_executable(${SUB_TEST_TARGET_NAME} ${cpp_file})
target_compile_options(${SUB_TEST_TARGET_NAME} PUBLIC -Wno-misleading-indentation)
target_compile_options(${SUB_TEST_TARGET_NAME} PUBLIC -O1 -Wno-misleading-indentation)
target_include_directories(${SUB_TEST_TARGET_NAME} PRIVATE ${CMAKE_SOURCE_DIR})
target_precompile_headers(${SUB_TEST_TARGET_NAME} REUSE_FROM ${target_pch})
target_link_libraries(${SUB_TEST_TARGET_NAME}
Expand Down
8 changes: 8 additions & 0 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ target_precompile_headers(unit_pch PRIVATE
"$<$<COMPILE_LANGUAGE:CXX>:<gtest/gtest.h$<ANGLE-R>>"
"$<$<COMPILE_LANGUAGE:C>:<stddef.h$<ANGLE-R>>"
)
target_compile_options(unit_pch PUBLIC -O1 -Wno-misleading-indentation)
if (STAN_OPENCL)
target_link_libraries(unit_pch OpenCL::OpenCL)
target_include_directories(unit_pch PRIVATE ${CLCPP_SOURCE_DIR}/include)
endif()
if (STAN_MPI)
target_link_libraries(unit_pch Boost::mpi MPI::MPI_CXX)
endif()

target_link_libraries(unit_pch
gtest_main benchmark::benchmark TBB::tbb
Expand Down

0 comments on commit 627505a

Please sign in to comment.