Skip to content
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

Add Module For Checking Atomic #117

Merged
merged 1 commit into from
Jun 24, 2022
Merged

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.
@sonarcloud
Copy link

sonarcloud bot commented Jun 24, 2022

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
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.

2 participants