Skip to content

Conversation

@jungleraptor
Copy link
Contributor

@jungleraptor jungleraptor commented Jun 24, 2022

Some toolchains require explicitly linking against libatomic

If such linking is required, then this function sets the
value of result to "atomic". Otherwise it remains untouched.
This makes it so that the function only needs to be called once
per project.

It can be used as follows:

include(CheckAtomic)
check_cxx_needs_atomic(LINK_ATOMIC)
target_link_libraries(foo PRIVATE ${LINK_ATOMIC})
...
target_link_libraries(bar PRIVATE ${LINK_ATOMIC})

Adds function for detection if linking against libatomic is
required.
@jungleraptor jungleraptor force-pushed the itorres/detect-needs-atomic branch from 24e61b5 to c690e32 Compare June 24, 2022 03:20
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@jungleraptor jungleraptor requested a review from RReichert June 24, 2022 03:27
@jungleraptor
Copy link
Contributor Author

@RReichert What are the advantages of a C based version?

I can still look into implementing that also.

@RReichert
Copy link
Contributor

@RReichert What are the advantages of a C based version?

I can still look into implementing that also.

Just in case we want to use atomic in C programs, which we currently don't have a need for, so its not necessary.

@jungleraptor jungleraptor merged commit 449f9b3 into master Jun 24, 2022
@jungleraptor jungleraptor deleted the itorres/detect-needs-atomic branch June 24, 2022 16:08
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.

3 participants