[Yunq] Move yunq cmake macro to yunq dir.
This commit is contained in:
parent
60de1ec9d3
commit
598816df12
|
@ -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.
|
||||
|
|
|
@ -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()
|
Loading…
Reference in New Issue