Skip to content

Commit

Permalink
do not link against OBJECT library directly; fixes #33
Browse files Browse the repository at this point in the history
  • Loading branch information
bast committed May 3, 2019
1 parent 5dab817 commit 636dac3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion numgrid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ add_library(
$<TARGET_OBJECTS:numgrid-objects>
)

# this is an ugly hack to make the unit tests link
# a nicer solution would be not to duplicate this info
# since the target dependencies are already expressed
# in numgrid-objects
target_include_directories(
numgrid-shared
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}
)

set_target_properties(
numgrid-shared
PROPERTIES
Expand Down Expand Up @@ -61,7 +71,7 @@ if(ENABLE_FC_SUPPORT)
target_link_libraries(
numgrid_fortran_bindings
PRIVATE
numgrid-objects
numgrid-shared
)
endif()

Expand Down
4 changes: 2 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ target_include_directories(
target_link_libraries(
cpp_test
PRIVATE
numgrid-objects
numgrid-shared
gtest_main
)

Expand All @@ -52,7 +52,7 @@ if(ENABLE_FC_SUPPORT)
target_link_libraries(
fortran_${_test}
numgrid_fortran_bindings
numgrid-objects
numgrid-shared
)

add_test(
Expand Down

0 comments on commit 636dac3

Please sign in to comment.