Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploydocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
cmake --build . --target build-docs

- name: Deploy Documentation to gh-pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/docs/html/
18 changes: 9 additions & 9 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-python@v2

- uses: pre-commit/action@v2.0.3
with:
extra_args: --from-ref origin/vara-dev --to-ref HEAD
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1
with:
extra_args: --from-ref origin/vara-dev --to-ref HEAD
- uses: pre-commit-ci/lite-action@v1.1.0
if: always()
2 changes: 1 addition & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
48 changes: 45 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,35 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS YES)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options(-stdlib=libstdc++)
if(APPLE)
# Clang on macOS must use libc++
add_compile_options(-stdlib=libc++)
elseif(UNIX AND NOT APPLE)
# Clang on Linux can use libstdc++ (usually default) No need to explicitly
# add this unless required
add_compile_options(-stdlib=libstdc++)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make this optional or maybe don't set it at all, as it is currently not necessary to be specified for UNIX systems where the system default gets chosen.

PS: I compile with libc++ on some UNIX setup 🥲

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I do not need it, was not sure if that should be in it.
Should I remove it or what would be the way to make it optional to be helpful for Linux?

Copy link
Contributor

Choose a reason for hiding this comment

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

There are two options, either remove the line for unix and only keep it for apple or introduce a cmake options that let's one "choose" one of the two libs. something like VARA_FEATURE_USE_STD_LIB where one then can insert the lib wanted.

endif()
endif()

# if(APPLE) execute_process( COMMAND xcrun --show-sdk-path OUTPUT_VARIABLE
# MACOS_SDK_PATH OUTPUT_STRIP_TRAILING_WHITESPACE )
# include_directories("${MACOS_SDK_PATH}/usr/include/c++/v1") endif()

if(APPLE)
if(NOT DEFINED CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES
"arm64"
CACHE STRING "" FORCE
)
endif()
endif()

if(APPLE)
set(Python3_ROOT_DIR "/opt/homebrew") # cmake-lint: disable=C0103
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh boy, someone should fix the cmake find package for python 😆 or why is it necessary to specify the actual root beforehand where it's not on other systems?

endif()

find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this always necessary here? If I remember correctly, we only searched for python where we needed it for the bindings but I'm not sure if we did this our selfs or if we just used what pybind found.

Copy link
Contributor

Choose a reason for hiding this comment

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

?


# VARA_FEATURE options
option(VARA_FEATURE_COLORED_OUTPUT "Produce ANSI-colored output" TRUE)
if(${VARA_FEATURE_COLORED_OUTPUT})
Expand Down Expand Up @@ -150,11 +176,27 @@ if(NOT VARA_FEATURE_IN_TREE)
# Only search for LLVM if we build out of tree
if(DEFINED LLVM_REQUESTED_VERSION)
message(STATUS "Using LLVM ${LLVM_REQUESTED_VERSION}")
find_package(LLVM ${LLVM_REQUESTED_VERSION} REQUIRED CONFIG)
find_package(
LLVM
${LLVM_REQUESTED_VERSION}
REQUIRED
CONFIG
HINTS
"/opt/homebrew/opt/llvm/lib/cmake/llvm" # macOS ARM (Homebrew)
"/usr/lib/llvm-${LLVM_REQUESTED_VERSION}/lib/cmake/llvm" # Linux (Debian)
"/usr/lib/llvm/lib/cmake/llvm" # Generic fallback
)
else()
message(STATUS "Using LLVM (default)")
set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
find_package(LLVM REQUIRED CONFIG)
find_package(
LLVM
REQUIRED
CONFIG
HINTS
"/opt/homebrew/opt/llvm/lib/cmake/llvm"
"/usr/lib/llvm/lib/cmake/llvm"
)
endif()

if(NOT "${LLVM_VERSION_MAJOR}" GREATER_EQUAL "${MIN_LLVM_REQUIRED}")
Expand Down
Loading