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

cmake fail to generate build file for target rv-virt:ksmp64 #11861

Open
inochisa opened this issue Mar 7, 2024 · 1 comment
Open

cmake fail to generate build file for target rv-virt:ksmp64 #11861

inochisa opened this issue Mar 7, 2024 · 1 comment

Comments

@inochisa
Copy link
Contributor

inochisa commented Mar 7, 2024

I got an error when generating build file for rv-virt:ksmp64 with cmake.

# cmake .. -DBOARD_CONFIG=rv-virt:ksmp64 -GNinja

-- Initializing NuttX
--   Board:  rv-virt
--   Config: ksmp64
--   Appdir: /mnt/files/inochi/cache/mainline/nuttx/../apps
-- Configuring done (1.1s)
CMake Error at CMakeLists.txt:736 (add_executable):
  No SOURCES given to target: nuttx_user


CMake Error at cmake/nuttx_add_library.cmake:90 (add_library):
  No SOURCES given to target: arch_interface
Call Stack (most recent call first):
  arch/CMakeLists.txt:29 (nuttx_add_system_library)


CMake Generate step failed.  Build files cannot be regenerated correctly.

I have tried the following change, but get another error: ninja: error: 'syscall/stubs/nuttx_host_tools', needed by 'syscall/stubs/STUB__assert.c', missing and no known rule to make it

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fce86072c0..730a84cedb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -732,7 +732,7 @@ endif()
 
 # Userspace portion ##########################################################
 
-if(NOT CONFIG_BUILD_FLAT)
+if(NOT CONFIG_BUILD_FLAT AND CONFIG_NUTTX_USERSPACE)
   add_executable(nuttx_user)
 
   get_property(nuttx_system_libs GLOBAL PROPERTY NUTTX_SYSTEM_LIBRARIES)
diff --git a/arch/risc-v/src/common/CMakeLists.txt b/arch/risc-v/src/common/CMakeLists.txt
index f704b210d0..91e59b83a1 100644
--- a/arch/risc-v/src/common/CMakeLists.txt
+++ b/arch/risc-v/src/common/CMakeLists.txt
@@ -100,3 +100,4 @@ if(CONFIG_ARCH_ADDRENV)
 endif()
 
 target_sources(arch PRIVATE ${SRCS})
+target_sources(arch_interface PRIVATE ${SRCS})

I wonder whether there is something I missed. My cmake version is 3.28.3

@anchao
Copy link
Contributor

anchao commented Mar 8, 2024

Cmake does not support Kernel(CONFIG_BUILD_KERNEL) / Protected(CONFIG_BUILD_PROTECTED) mode building currently. Please use Makefile to build if the board defconfig contains dependencies on these two modes.

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

No branches or pull requests

2 participants