Skip to content

Commit 708b844

Browse files
committed
Attempt to get Petsc build with static library
This adds the private libs to the petsc link line. It *should* work even if petsc built as a shared library.
1 parent e5f1bbe commit 708b844

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

src/pcms/transfer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ target_link_libraries(pcms_transfer PUBLIC
4848

4949
target_link_libraries(pcms_transfer PUBLIC meshfields::meshfields)
5050

51-
target_link_libraries(pcms_transfer PUBLIC PkgConfig::PETSC)
51+
target_link_libraries(pcms_transfer PRIVATE PkgConfig::PETSC)
5252

5353
target_include_directories(pcms_transfer INTERFACE
5454
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

test/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,7 @@ if(Catch2_FOUND)
415415
# target_link_libraries(unit_tests PUBLIC meshfields::meshfields)
416416
# endif()
417417

418-
# if (PCMS_ENABLE_PETSC)
419-
# # TODO, update to pkgconfig target instead
420-
# target_include_directories(unit_tests PUBLIC ${PCMS_PETSC_INCLUDES})
421-
# target_link_libraries(unit_tests PUBLIC ${PCMS_PETSC_LIBRARIES})
422-
#endif()
418+
target_link_libraries(unit_tests PRIVATE PkgConfig::PETSC)
423419

424420
target_link_libraries(unit_tests PUBLIC
425421
Catch2::Catch2

0 commit comments

Comments
 (0)