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

Workaround 20.04 FindBoost issue #145

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ if (DO_PLATFORM_LINUX)

# relro+now thwarts some attack vectors by reordering some ELF data structures and also by making the GOT read-only
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie -z relro -z now")

# Depending on the ordering in PATH environment variable (observed on Ubuntu2004), cmake might search
# /lib instead of /usr/lib which causes Boost::headers to get the non-existent "/include" path.
# (Enable --trace-expand in cmake and look at lines from boost_headers-config.cmake and its callers.)
# Workaround: force cmake to look in "/usr" since the /lib and /bin paths are either
# not relevant for our usage or they are symlinks to /usr/lib and /usr/bin.
set(CMAKE_PREFIX_PATH "/usr")
Copy link

@JeffMill JeffMill Dec 22, 2022

Choose a reason for hiding this comment

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

are we okay just always using /usr/* ? is there ever a case where we'd want to search /lib or /bin ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Build is successful on all of the platforms we target today. We will definitely revisit if it breaks somewhere.

endif (DO_PLATFORM_LINUX)

if (DO_PLATFORM_WINDOWS AND DO_INCLUDE_SDK)
Expand Down