Skip to content

Limit use of Posix threads to Unix - #4140

Merged
parrt merged 1 commit into
antlr:devfrom
hs-apotell:threads
Mar 3, 2023
Merged

parrt merged 1 commit into
antlr:devfrom
hs-apotell:threads

Conversation

@hs-apotell

Copy link
Copy Markdown
Collaborator

Posix threads are available only on Unix (and unix like) platforms. Wrap the dependency accordingly so builds don't fail on other platforms.

Signed-off-by: HS hs@apotell.com

Posix threads are available only on Unix (and unix like) platforms.
Wrap the dependency accordingly so builds don't fail on other platforms.

Signed-off-by: HS <hs@apotell.com>
@hs-apotell

Copy link
Copy Markdown
Collaborator Author

@parrt Can you assist with getting this merged to master. Thanks!

@parrt

parrt commented Feb 25, 2023

Copy link
Copy Markdown
Member

hyperbusy but soon. we have similar PR btw.

@jmairboeck

Copy link
Copy Markdown
Contributor

Threads is a built-in meta-target of CMake and should resolve to nothing on platforms which don't require a separate threading library anyway. So this is probably not needed.

@hs-apotell

Copy link
Copy Markdown
Collaborator Author

When antlr is exported as a dependency, Threads ends up in the antlr4.cmake file which doesn't resolve to nothing, at least on Windows. This is the currently the case for Surelog where the builds are failing for projects dependent on Surelog library, only on Windows where cmake fails to resolve it.

@hs-apotell

Copy link
Copy Markdown
Collaborator Author

@jmairboeck @parrt Any update on this PR?

@parrt parrt added this to the 4.12.1 milestone Mar 3, 2023
@parrt
parrt merged commit d641b6b into antlr:dev Mar 3, 2023
@hs-apotell
hs-apotell deleted the threads branch March 15, 2023 19:43
jimidle pushed a commit to jimidle/antlr4 that referenced this pull request Mar 28, 2023
Posix threads are available only on Unix (and unix like) platforms.
Wrap the dependency accordingly so builds don't fail on other platforms.

Signed-off-by: HS <hs@apotell.com>
Signed-off-by: Jim.Idle <jimi@idle.ws>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants