Skip to content

Commit

Permalink
Improve linking for builder1 and builder2.
Browse files Browse the repository at this point in the history
The creational_patterns library is required for the builder library, but
this was not specified yet.  It is now added as a PUBLIC link library
for builder and because of that, we no longer need to specify it as a
linker library for builder1 and builder2.
  • Loading branch information
BartVandewoestyne committed Feb 12, 2024
1 parent a0d21f8 commit 89a27ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Creational_Patterns/Builder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ set(builder_SRCS

add_library(builder SHARED ${builder_SRCS})
target_include_directories(builder PUBLIC ../)
target_link_libraries(builder PUBLIC creational_patterns)

add_executable(builder1 builder1.cpp)
add_executable(builder2 builder2.cpp)

target_link_libraries(builder1 builder creational_patterns)
target_link_libraries(builder2 builder creational_patterns)
target_link_libraries(builder1 PRIVATE builder)
target_link_libraries(builder2 PRIVATE builder)

0 comments on commit 89a27ef

Please sign in to comment.