[GH-ISSUE #416] Switch to POSITION_INDEPDENT_CODE instead of manually specifying -fPIC #323

Closed
opened 2026-05-05 06:02:27 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @AdrianKoshka on GitHub (Aug 23, 2019).
Original GitHub issue: https://github.com/debauchee/barrier/issues/416

Originally assigned to: @AdrianKoshka on GitHub.

if (UNIX)
    if (NOT APPLE)
        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
    endif()

I don't know a lot (if anything) about CMake, but it seems instead of manually setting compiler flags, we could instead use the POSITION_INDEPENDENT_CODE option that CMake provides. The above snippet is from: https://github.com/debauchee/barrier/blob/master/CMakeLists.txt#L54-L57

Originally created by @AdrianKoshka on GitHub (Aug 23, 2019). Original GitHub issue: https://github.com/debauchee/barrier/issues/416 Originally assigned to: @AdrianKoshka on GitHub. ```CMake if (UNIX) if (NOT APPLE) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") endif() ``` I don't know a lot (if anything) about CMake, but it seems instead of manually setting compiler flags, we could instead use the [POSITION_INDEPENDENT_CODE](https://cmake.org/cmake/help/v3.0/prop_tgt/POSITION_INDEPENDENT_CODE.html) option that CMake provides. The above snippet is from: https://github.com/debauchee/barrier/blob/master/CMakeLists.txt#L54-L57
gitea-mirror 2026-05-05 06:02:27 -06:00
Author
Owner

@AdrianKoshka commented on GitHub (Aug 23, 2019):

fixed with #417

<!-- gh-comment-id:524443606 --> @AdrianKoshka commented on GitHub (Aug 23, 2019): fixed with #417
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/barrier#323
No description provided.