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

Fix builds on macOS #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix builds on macOS #69

wants to merge 1 commit into from

Conversation

atheriel
Copy link
Contributor

This fixes a few compatibility cases and allows the project to be built on macOS:

  • Define HOST_NAME_MAX to its POSIX equivalent if not present.

  • Gate calls to ptrctl(), which is a Linux-specific syscall.

  • Include <signal.h>, which is the canonical header for kill().

  • Use C++17, which is required for our use of weak_for_this() when building with Clang.

macOS builds are useful for testing with the smoke-test tool; obviously the Launcher itself does not run on macOS.

This fixes a few compatibility cases and allows the project to be built
on macOS:

* Define HOST_NAME_MAX to its POSIX equivalent if not present.

* Gate calls to ptrctl(), which is a Linux-specific syscall.

* Include <signal.h>, which is the canonical header for kill().

* Use C++17, which is required for our use of weak_for_this() when
  building with Clang.

macOS builds are useful for testing with the smoke-test tool; obviously
the Launcher itself does not run on macOS.

Signed-off-by: Aaron Jacobs <[email protected]>
@bdeitte
Copy link
Collaborator

bdeitte commented Jul 14, 2022

Nice to see, thanks! Heads up @nahara7 and @bschwedler

@bschwedler
Copy link
Contributor

@kfeinauer Do you foresee any issues with updating the C++ standard used?

@kfeinauer
Copy link
Contributor

We will need to check the compatibility matrices of our supported operating systems to make sure that their version of GCC supports C++17. My gut feeling is that there is likely a supported OS that is too old.

We could modify this PR to conditionally set the standard just for macOS builds, otherwise.

@atheriel
Copy link
Contributor Author

atheriel commented Aug 4, 2022

That sounds right to me.

A slightly more generic approach may be to test whether CMAKE_CXX_COMPILER_ID indicates GCC, rather than assuming Linux uses GCC and macOS uses Clang.

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.

4 participants