moves the registration TU out of the core library into the final targets - #33
Merged
Merged
Conversation
the shared library no longer forces a choice of interface. camerad and the python module each link exactly one registration.
astronomerdave
requested review from
mikelangmayr,
prkrtg and
scizen9
as code owners
September 23, 2026 21:10
Contributor
|
prkrtg
reviewed
Sep 23, 2026
| add_executable(camerad | ||
| ${CAMERAD_DIR}/camerad.cpp | ||
| ${CAMERAD_DIR}/camera_server.cpp | ||
| ${INSTRUMENT_SOURCES} |
Contributor
There was a problem hiding this comment.
By doing this change, I think it will compile the instrument sources twice
We can instead build specifically the interface factory <instrument_name>_interface_factory.cpp
set (INSTRUMENT_REGISTRATION ${INSTRUMENT_SOURCES})
list (FILTER INSTRUMENT_REGISTRATION INCLUDE REGEX "_interface_factory\\.cpp$")
list (FILTER INSTRUMENT_SOURCES EXCLUDE REGEX "_interface_factory\\.cpp$")
then you can do
add_executable(camerad
${CAMERAD_DIR}/camerad.cpp
${CAMERAD_DIR}/camera_server.cpp
${INSTRUMENT_REGISTRATION}
)
Contributor
Author
There was a problem hiding this comment.
You're right, give me a moment
Contributor
Author
|
@prkrtg implementation goes into an object library so it compiles once without landing back in the core library. |
prkrtg
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Required to meet camera 2.0 design
One of the design requirements was that:
The previous build violates this by appending
${INSTRUMENT_SOURCES}intoINTERFACE_SOURCES, which becomes the controller library. So the shared library carries a registration, and with an instrument selected, the instrument's sources.This moves
${INSTRUMENT_SOURCES}to thecameradexecutable and thecamera_interfacepython module. Both callInterface::create(), so both need it, and each ends up with exactly one. No runtime behavior changes.Verified with generic build,
-DINSTRUMENT=hispec_tracking_camera, and-DBUILD_PYTHON_MODULE=ON. With hispec selected:libarchon.a— 0 hispec symbols, 0Interface::createdefinitions; previously it carried all four instrument objectsbin/camerad— 262 hispec symbols, 1Interface::createopen,load,power on,expose 1against the emulator all return DONE, and a FITS file is written