From 598816df1222de56467412a3f9b44583c4e852eb Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Wed, 25 Oct 2023 22:18:29 -0700 Subject: [PATCH] [Yunq] Move yunq cmake macro to yunq dir. --- CMakeLists.txt | 36 +----------------------------------- yunq/CMakeLists.txt | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 yunq/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c384ff..b1fca57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,43 +12,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS True) set(BASE_COMPILE_FLAGS "-ffreestanding -fno-rtti -fno-exceptions -mgeneral-regs-only") set(BASE_LINK_FLAGS "-nostdlib") -set(PYTHON "${CMAKE_SOURCE_DIR}/yunq/venv/bin/python") -set(YUNQ "${CMAKE_SOURCE_DIR}/yunq/yunq.py") - -macro(yunq_gen dir include_dir name) - set(file_bundle ${name}_yunq_files) - set(target ${name}_yunq) - set(${file_bundle} - ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${name}.yunq.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${name}.yunq.client.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${name}.yunq.server.cpp - ) - - add_library(${target} - ${${file_bundle}} - ) - - target_include_directories(${target} - PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${include_dir}" - ) - - target_link_libraries(${target} - mammoth - ) - set_target_properties(${target} PROPERTIES - COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_COMPILE_FLAGS}" - LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${BASE_LINK_FLAGS}" - ) - - add_custom_command( - OUTPUT ${${file_bundle}} - COMMAND ${PYTHON} ${YUNQ} ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${name}.yunq - DEPENDS ${dir}/${name}.yunq - ) -endmacro() - add_subdirectory(zion) add_subdirectory(lib) +add_subdirectory(yunq) add_subdirectory(sys) # Use machine q35 to access PCI devices. diff --git a/yunq/CMakeLists.txt b/yunq/CMakeLists.txt new file mode 100644 index 0000000..c42d72d --- /dev/null +++ b/yunq/CMakeLists.txt @@ -0,0 +1,34 @@ +set(PYTHON "${CMAKE_SOURCE_DIR}/yunq/venv/bin/python") +set(YUNQ "${CMAKE_SOURCE_DIR}/yunq/yunq.py") + +macro(yunq_gen dir include_dir name) + set(file_bundle ${name}_yunq_files) + set(target ${name}_yunq) + set(${file_bundle} + ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${name}.yunq.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${name}.yunq.client.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${name}.yunq.server.cpp + ) + + add_library(${target} + ${${file_bundle}} + ) + + target_include_directories(${target} + PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${include_dir}" + ) + + target_link_libraries(${target} + mammoth + ) + set_target_properties(${target} PROPERTIES + COMPILE_FLAGS "${CMAKE_CXX_FLAGS} ${BASE_COMPILE_FLAGS}" + LINK_FLAGS "${CMAKE_EXE_LINK_FLAGS} ${BASE_LINK_FLAGS}" + ) + + add_custom_command( + OUTPUT ${${file_bundle}} + COMMAND ${PYTHON} ${YUNQ} ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${name}.yunq + DEPENDS ${dir}/${name}.yunq + ) +endmacro()