jiridanek commented on a change in pull request #1267:
URL: https://github.com/apache/qpid-dispatch/pull/1267#discussion_r655416842



##########
File path: tests/CMakeLists.txt
##########
@@ -40,8 +40,8 @@ set(unit_test_SOURCES
     thread_test.c
     )
 
-add_executable(unit_tests ${unit_test_SOURCES})
-target_link_libraries(unit_tests  qpid-dispatch)
+add_executable(unit_tests ${unit_test_SOURCES} $<TARGET_OBJECTS:qpid-dispatch>)
+target_link_libraries(unit_tests qpid-dispatch-libraries)

Review comment:
       The static library is empty, it is only CMake target that carries 
dependencies of qpid-dispatch. Like INTERFACE library, but that is not 
supported in CMake 3.8.12.2. I have to propagate the PUBLIC/INTERFACE 
dependencies of the object files in `$<TARGET_OBJECTS:qpid-dispatch>` somehow.
   
   If I had CMake 3.12, I could do `target_link_libraries(unit_tests 
qpid-dispatch)` and be done with it. For older CMake, I have to add the object 
files into `add_executable`, but that does nothing about link dependencies. So 
I'd have to have e.g. a variable.... I thought that a `-libraries` static 
library containing no symbols of its own is cleaner. (The library will actually 
have to contain something due to the macOS error I mentioned above.)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to