Skip to content

Allow building zlib and libsbml at the same time.#474

Merged
fbergmann merged 2 commits intodevelopmentfrom
allow-build-with-co-zlib
Mar 11, 2026
Merged

Allow building zlib and libsbml at the same time.#474
fbergmann merged 2 commits intodevelopmentfrom
allow-build-with-co-zlib

Conversation

@luciansmith
Copy link
Member

The check_library_exists function breaks my build when building both zlib and libsbml at once. I get the error:

CMake Error at C:/Users/Lucian/Desktop/libroadrunner-deps-backup/build-debug/CMakeFiles/CMakeScratch/TryCompile-m25yy5/CMakeLists.txt:28 (target_link_libraries):
Error evaluating generator expression:

$<TARGET_LINKER_FILE:zlibstatic>

No target "zlibstatic"

If I then hit compile again, it works! But the first time, it fails, and it needs to work the first time for my github action.

This problem was obfuscated by it previously trying to assign the result to LIBZ_CMAKE_PATH, which already existed, so it... broke the check? Maybe? Anyway.

I don't think we need to check that the library exists anyway. We don't do it for any of the XML libraries, and only do it for BZip. Which would probably also break my build, but I'm not including bzip in my build at all.

The check_library_exists function breaks my build when building both zlib and libsbml at once.  I get the error:

CMake Error at C:/Users/Lucian/Desktop/libroadrunner-deps-backup/build-debug/CMakeFiles/CMakeScratch/TryCompile-m25yy5/CMakeLists.txt:28 (target_link_libraries):
  Error evaluating generator expression:

    $<TARGET_LINKER_FILE:zlibstatic>

  No target "zlibstatic"

If I then hit compile again, it works!  But the first time, it fails, and it needs to work the first time for my github action.

This problem was obfuscated by it previously trying to assign the result to LIBZ_CMAKE_PATH, which already existed, so it... broke the check?  Maybe?  Anyway.

I don't think we need to check that the library exists anyway.  We don't do it for any of the XML libraries, and only do it for BZip.  Which would probably also break my build, but I'm not including bzip in my build at all.
@luciansmith luciansmith requested a review from fbergmann March 9, 2026 23:19
By default no test for symbols from the library will be made, but if `ZLIB_CHECK_FOR_SYMBOLS` is defined the library will be checked.
Copy link
Member

@fbergmann fbergmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luciansmith rather than leave the code there commented out i just disabled it, leaving people to enable it if they had a need.

This should solve your original issue.

Otherwise its fine to just remove the statements altogether, but then the line changing the path to the zlib library should also be changed. Oh and the error message was just wrong and did not actually print the name of the zlib library.

@luciansmith
Copy link
Member Author

Looks good to me! Is there something more you wanted someone to do, cf "changing the path to the zlib library should also be changed"? Or is this ready to merge?

@fbergmann
Copy link
Member

@luciansmith thats all included in my change so its ready to merge and i will

@fbergmann fbergmann merged commit 9282299 into development Mar 11, 2026
35 checks passed
@fbergmann fbergmann deleted the allow-build-with-co-zlib branch March 11, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants