-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation fails without python #6
Comments
I'm having the same issue trying to cross-compile in a Docker container with no python installed. It seems most of the targets are tests. I'm tempted to call out running tests by default as a bad practice because the target can't always be executed on the system that is compiling it. With some guidance, I would be interested in trying to make a patch to fix this. EDIT: I see there is already a PR for this: #9 |
Here is a list of failed targets that are NOT tests that fail because they link against boost::python:
via the cmake errors:
|
The tests do not run by default, and the test should by default still configure even with missing targets. This is because it |
I tried a little digging. It looks like
Could this be the problem? I'm not sure what this shadow target stuff is. EDIT: This is more accurate. sorry
|
So I need to write a document explaining some of the design rationale. Here some background. The library overrides The shadow targets are used to emulate # Custom property to check if target exists
define_property(TARGET PROPERTY "INTERFACE_TARGET_EXISTS"
BRIEF_DOCS "True if target exists"
FULL_DOCS "True if target exists"
)
# Create shadow target to notify that the target exists
macro(shadow_notify TARGET)
if(NOT TARGET _shadow_target_${TARGET})
add_library(_shadow_target_${TARGET} INTERFACE IMPORTED GLOBAL)
endif()
set_target_properties(_shadow_target_${TARGET} PROPERTIES INTERFACE_TARGET_EXISTS 1)
endmacro()
# Check if target exists by querying the shadow target
macro(shadow_exists OUT TARGET)
if(NOT TARGET _shadow_target_${TARGET})
add_library(_shadow_target_${TARGET} INTERFACE IMPORTED GLOBAL)
set_target_properties(_shadow_target_${TARGET} PROPERTIES INTERFACE_TARGET_EXISTS 0)
endif()
set(${OUT} "$<TARGET_PROPERTY:_shadow_target_${TARGET},INTERFACE_TARGET_EXISTS>")
endmacro() This creates two functions, and a custom property to track if the target exists or not. The The The
The |
Perhaps that is a rabbit hole. It appears that I tried excluding several libraries and it created more explosions like this one:
|
Yes of course, because each project can be built independently without the superproject. So for now, if you exclude a library you need to manually exclude its dependencies. I don't know of an easy way to exclude the dependencies automatically.
Yea that's definitely a bug. The missing dependencies for a test shouldn't cause it to break like that unless |
When CMake can't find python, the boost::python package is correctly skipped.
However, the parameter library still tries to link with it.
This causes several errors after the configuration phase such as:
An easy way to reproduce this is, for example, to do a 64 build on a machine with only the 32-bit python libraries present.
Commenting out the line I referenced solved the problem in this case, and I was able to build the project - so I think it should be conditional.
And also, other, optionally built libraries referenced in this way could cause similar issues.
The text was updated successfully, but these errors were encountered: