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 cmake check for deducing 32bit or 64bit RISCV #2330

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

Conversation

kraj
Copy link

@kraj kraj commented Sep 17, 2024

Currently its only compilable for RV64 when RVV is enabled, this will extend it to build for RV32 with RVV as well

Upstream-Status: Pending

Currently its only compilable for RV64 when RVV is
enabled, this will extend it to build for RV32 with
RVV as well
@@ -59,6 +59,32 @@ if(CHECK_PIE_SUPPORTED)
endif()
endif()

include(CheckCSourceCompiles)

check_c_source_compiles("
Copy link
Member

Choose a reason for hiding this comment

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

Thanks, this looks good.
Would you mind making one minor change, wrapping this in something like if (CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "RISCV32|RISCV64|RISCV128" OR CMAKE_SYSTEM_PROCESSOR MATCHES "riscv32|riscv64|riscv128")) so we do not get extra output on non-RISCV platforms?

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