Skip to content

Commit 636dac3

Browse files
committed
do not link against OBJECT library directly; fixes #33
1 parent 5dab817 commit 636dac3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

numgrid/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ add_library(
3333
$<TARGET_OBJECTS:numgrid-objects>
3434
)
3535

36+
# this is an ugly hack to make the unit tests link
37+
# a nicer solution would be not to duplicate this info
38+
# since the target dependencies are already expressed
39+
# in numgrid-objects
40+
target_include_directories(
41+
numgrid-shared
42+
PUBLIC
43+
${CMAKE_CURRENT_BINARY_DIR}
44+
)
45+
3646
set_target_properties(
3747
numgrid-shared
3848
PROPERTIES
@@ -61,7 +71,7 @@ if(ENABLE_FC_SUPPORT)
6171
target_link_libraries(
6272
numgrid_fortran_bindings
6373
PRIVATE
64-
numgrid-objects
74+
numgrid-shared
6575
)
6676
endif()
6777

test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ target_include_directories(
3333
target_link_libraries(
3434
cpp_test
3535
PRIVATE
36-
numgrid-objects
36+
numgrid-shared
3737
gtest_main
3838
)
3939

@@ -52,7 +52,7 @@ if(ENABLE_FC_SUPPORT)
5252
target_link_libraries(
5353
fortran_${_test}
5454
numgrid_fortran_bindings
55-
numgrid-objects
55+
numgrid-shared
5656
)
5757

5858
add_test(

0 commit comments

Comments
 (0)