Skip to content

Commit

Permalink
ADD: update CMake rules
Browse files Browse the repository at this point in the history
  • Loading branch information
T-K-233 committed Jul 20, 2024
1 parent fd12cf0 commit cf848b5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ option(X86 "Build for x86" OFF )
option(RISCV "Build for RISC-V" OFF )

# accelerator options
option(AVX "Use AVX implementation" OFF)
option(RVV "Use RISCV vector extension implementation" OFF)
option(ZVFH "Use RISCV vector extension with half precision floating point" OFF)
option(AVX "Use AVX implementation" OFF )
option(RVV "Use RISCV vector extension" OFF )
option(ZVFH "Use RISCV half-precision floating-point vector extension" OFF)


add_compile_options(-O1 -Wall -Wextra)
Expand All @@ -49,18 +49,21 @@ set(SPECS_FILE "htif_nano.specs")
set(SPEC_FLAGS -specs=${SPECS_FILE} -specs=${WRAP_SPECS_FILE})

set(MARCH "rv64gc")
set(MABI "lp64d")
set(MCMODEL "medany")

# generate march flags
if (RVV)
list(APPEND MARCH "v")
list(APPEND MARCH "_zicntr")

if (ZVFH)
list(APPEND MARCH "_zfh")
list(APPEND MARCH "_zvfh")
endif()
endif()

list(JOIN MARCH "" MARCH)
set(MABI "lp64d")
set(MCMODEL "medany")

if (NOT DEFINED LINKER_SCRIPT)
set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/toolchain/htif.ld)
Expand Down

0 comments on commit cf848b5

Please sign in to comment.