mirror of
https://github.com/apache/nuttx.git
synced 2026-09-27 18:58:27 +08:00
cmake:init RISC-V cmake qemu-rv build
cmake currently does not support non-FlatBuild, need disable ELF and LOADABLE when compiling other defconfigs ``` cmake -B build -DBOARD_CONFIG=rv-virt/smp64 -GNinja # for rv32:rv-virt/smp cmake --build build -t menuconfig cmake --build build qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -smp 8 -bios none -kernel nuttx -nographic ``` Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(gnu)
|
||||
|
||||
if(CONFIG_ARCH_RV64GC)
|
||||
add_subdirectory(rv64)
|
||||
@@ -26,3 +26,11 @@ endif()
|
||||
if(CONFIG_ARCH_RV32IM)
|
||||
add_subdirectory(rv32)
|
||||
endif()
|
||||
|
||||
set(SRCS)
|
||||
|
||||
if(CONFIG_LIBC_ARCH_ELF)
|
||||
list(APPEND SRCS arch_elf.c)
|
||||
endif()
|
||||
|
||||
target_sources(c PRIVATE ${SRCS})
|
||||
|
||||
@@ -17,14 +17,3 @@
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
set(SRCS)
|
||||
|
||||
if(CONFIG_LIBC_ARCH_ELF)
|
||||
list(APPEND SRCS arch_elf.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_SETJMP_H)
|
||||
list(APPEND SRCS arch_setjmp.S)
|
||||
endif()
|
||||
|
||||
target_sources(c PRIVATE ${SRCS})
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# ##############################################################################
|
||||
# libs/libc/machine/risc-v/gnu/CMakeLists.txt
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. The ASF licenses this
|
||||
# file to you under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations under
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS)
|
||||
|
||||
if(CONFIG_RISCV_MEMCPY)
|
||||
list(APPEND SRCS arch_memcpy.S)
|
||||
endif()
|
||||
|
||||
if(CONFIG_RISCV_MEMSET)
|
||||
list(APPEND SRCS arch_memset.S)
|
||||
endif()
|
||||
|
||||
if(CONFIG_RISCV_STRCMP)
|
||||
list(APPEND SRCS arch_strcmp.S)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_SETJMP_H)
|
||||
list(APPEND SRCS arch_setjmp.S)
|
||||
endif()
|
||||
|
||||
target_sources(c PRIVATE ${SRCS})
|
||||
@@ -17,6 +17,3 @@
|
||||
# the License.
|
||||
#
|
||||
# ##############################################################################
|
||||
if(CONFIG_RISCV_MEMCPY)
|
||||
target_sources(c PRIVATE arch_memcpy.S)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user