diff --git a/CMakeLists.txt b/CMakeLists.txt index f155585aa..b6d65f1e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,7 +83,7 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/doc) # 添加 run 和 debug target add_run_target( - DEPENDS $<$:boot> $<$:boot> $<$:boot> kernel + DEPENDS ovmf $<$:opensbi-fw_jump> $<$:boot> $<$:boot> $<$:boot> kernel WORKING_DIRECTORY ${PROJECT_BINARY_DIR} TARGET ${CMAKE_SYSTEM_PROCESSOR} BOOT ${PROJECT_BINARY_DIR}/src/boot/boot.efi diff --git a/cmake/3rd.cmake b/cmake/3rd.cmake index cc5c916fb..9cfcbbe79 100644 --- a/cmake/3rd.cmake +++ b/cmake/3rd.cmake @@ -116,6 +116,14 @@ if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "riscv64") ${opensbi_SOURCE_DIR}/include ${opensbi_BINARY_DIR}/include ) + add_library(opensbi-fw_jump INTERFACE) + add_dependencies(opensbi-fw_jump opensbi) + target_include_directories(opensbi-fw_jump INTERFACE + ${dtc_BINARY_DIR}/libfdt + ) + target_link_libraries(opensbi-fw_jump INTERFACE + ${dtc_BINARY_DIR}/libfdt/libfdt.a + ) # https://github.com/MRNIU/opensbi_interface.git add_subdirectory(3rd/opensbi_interface) diff --git a/cmake/compile_config.cmake b/cmake/compile_config.cmake index ba7956462..6bda192fe 100644 --- a/cmake/compile_config.cmake +++ b/cmake/compile_config.cmake @@ -206,16 +206,3 @@ target_link_libraries(DEFAULT_KERNEL_LINK_LIB INTERFACE $<$: > ) - -# 编译依赖 -list(APPEND COMPILE_DEPENDS - ovmf - ) -if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") -elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "riscv64") - list(APPEND COMPILE_DEPENDS - opensbi - opensbi_interface - ) -elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") -endif () diff --git a/src/boot/CMakeLists.txt b/src/boot/CMakeLists.txt index a62c94a19..8a32dfba7 100644 --- a/src/boot/CMakeLists.txt +++ b/src/boot/CMakeLists.txt @@ -30,11 +30,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE DEFAULT_BOOT_LINK_LIB ) -# 添加依赖 -add_dependencies(${PROJECT_NAME} - ${COMPILE_DEPENDS} -) - set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${BOOT_ELF_OUTPUT_NAME}) diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index 1fed0a78b..a3b8ce30d 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -52,11 +52,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE driver ) -# 添加依赖 -add_dependencies(${PROJECT_NAME} - ${COMPILE_DEPENDS} -) - set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${KERNEL_ELF_OUTPUT_NAME}) diff --git a/test/system_test/cxx_init_test/CMakeLists.txt b/test/system_test/cxx_init_test/CMakeLists.txt index b573b6cda..bba08d8bc 100644 --- a/test/system_test/cxx_init_test/CMakeLists.txt +++ b/test/system_test/cxx_init_test/CMakeLists.txt @@ -41,10 +41,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE libcxx ) -add_dependencies(${PROJECT_NAME} - ${COMPILE_DEPENDS} -) - set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${KERNEL_ELF_OUTPUT_NAME}) diff --git a/test/system_test/gnu_efi_test/CMakeLists.txt b/test/system_test/gnu_efi_test/CMakeLists.txt index fd64aeabb..69baa728b 100644 --- a/test/system_test/gnu_efi_test/CMakeLists.txt +++ b/test/system_test/gnu_efi_test/CMakeLists.txt @@ -36,10 +36,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE libcxx ) -add_dependencies(${PROJECT_NAME} - ${COMPILE_DEPENDS} -) - set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${KERNEL_ELF_OUTPUT_NAME}) diff --git a/test/system_test/opensbi_test/CMakeLists.txt b/test/system_test/opensbi_test/CMakeLists.txt index 32d90b7bb..927cdc3bd 100644 --- a/test/system_test/opensbi_test/CMakeLists.txt +++ b/test/system_test/opensbi_test/CMakeLists.txt @@ -33,10 +33,6 @@ target_link_libraries(${PROJECT_NAME} PRIVATE libcxx ) -add_dependencies(${PROJECT_NAME} - ${COMPILE_DEPENDS} -) - set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${KERNEL_ELF_OUTPUT_NAME}) diff --git a/test/unit_test/CMakeLists.txt b/test/unit_test/CMakeLists.txt index b2b8d3e4f..9646735c8 100644 --- a/test/unit_test/CMakeLists.txt +++ b/test/unit_test/CMakeLists.txt @@ -38,8 +38,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE ${dtc_BINARY_DIR}/libfdt/libfdt.a ) -add_dependencies(${PROJECT_NAME} - ${COMPILE_DEPENDS} -) - gtest_discover_tests(${PROJECT_NAME})