added M records
This commit is contained in:
parent
e0ce2fb3d0
commit
a711223abf
11 changed files with 297 additions and 20 deletions
|
|
@ -15,7 +15,8 @@ file(GLOB_RECURSE SOURCES "${PROJECT_SOURCE_DIR}/src/*.cpp")
|
|||
|
||||
|
||||
set(MAIN_SRC "${PROJECT_SOURCE_DIR}/src/main.cpp")
|
||||
list(REMOVE_ITEM SOURCES ${MAIN_SRC})
|
||||
set(ASSEMBLER_SRC "${PROJECT_SOURCE_DIR}/src/assembler.cpp")
|
||||
list(REMOVE_ITEM SOURCES ${MAIN_SRC} ${ASSEMBLER_SRC})
|
||||
|
||||
if(NOT SOURCES)
|
||||
message(WARNING "No source files found in ${PROJECT_SOURCE_DIR}/src — the build will create an empty library")
|
||||
|
|
@ -32,15 +33,9 @@ if(EXISTS "${PROJECT_SOURCE_DIR}/src/main.cpp")
|
|||
target_link_libraries(simulator_exec PRIVATE simulator_lib)
|
||||
endif()
|
||||
|
||||
|
||||
if(TARGET simulator_exec)
|
||||
add_custom_target(run
|
||||
DEPENDS simulator_exec
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Running simulator_exec..."
|
||||
COMMAND $<TARGET_FILE:simulator_exec>
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Builds and runs simulator_exec"
|
||||
)
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/src/assembler.cpp")
|
||||
add_executable(assembler "${PROJECT_SOURCE_DIR}/src/assembler.cpp")
|
||||
target_link_libraries(assembler PRIVATE simulator_lib)
|
||||
endif()
|
||||
|
||||
message(STATUS "Project: ${PROJECT_NAME}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue