1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 02:37:35 +00:00

Meta: Define and use lagom_tool() CMake helper function for all Tools

We'll use this to prevent repeating common tool dependencies. They all
depend on LibCore and AK only. We also want to encapsulate common
install rules for them.
This commit is contained in:
Andrew Kaster 2021-09-06 23:34:28 -06:00 committed by Ali Mohammad Pur
parent 567104607c
commit a6d83e02d2
6 changed files with 33 additions and 20 deletions

View file

@ -1,2 +1,15 @@
function(lagom_tool tool)
cmake_parse_arguments(LAGOM_TOOL "" "" "SOURCES" ${ARGN})
add_executable(${tool} ${SOURCES} ${LAGOM_TOOL_SOURCES})
# alias for parity with exports
add_executable(Lagom::${tool} ALIAS ${tool})
target_link_libraries(${tool} LagomCore)
install(
TARGETS ${tool}
EXPORT LagomTargets
RUNTIME COMPONENT Lagom_Runtime
)
endfunction()
add_subdirectory(ConfigureComponents) add_subdirectory(ConfigureComponents)
add_subdirectory(CodeGenerators) add_subdirectory(CodeGenerators)

View file

@ -2,5 +2,4 @@ set(SOURCES
main.cpp main.cpp
) )
add_executable(IPCCompiler ${SOURCES}) lagom_tool(IPCCompiler)
target_link_libraries(IPCCompiler LagomCore)

View file

@ -1,5 +1,11 @@
add_executable(GenerateUnicodeData GenerateUnicodeData.cpp) set(SOURCES
target_link_libraries(GenerateUnicodeData LagomCore) GenerateUnicodeData.cpp
)
add_executable(GenerateUnicodeLocale GenerateUnicodeLocale.cpp) lagom_tool(GenerateUnicodeData)
target_link_libraries(GenerateUnicodeLocale LagomCore)
set(SOURCES
GenerateUnicodeLocale.cpp
)
lagom_tool(GenerateUnicodeLocale)

View file

@ -1,11 +1,8 @@
add_executable(Generate_CSS_PropertyID_h Generate_CSS_PropertyID_h.cpp) set(SOURCES "") # avoid pulling SOURCES from parent scope
add_executable(Generate_CSS_PropertyID_cpp Generate_CSS_PropertyID_cpp.cpp)
add_executable(Generate_CSS_ValueID_h Generate_CSS_ValueID_h.cpp) lagom_tool(Generate_CSS_PropertyID_h SOURCES Generate_CSS_PropertyID_h.cpp)
add_executable(Generate_CSS_ValueID_cpp Generate_CSS_ValueID_cpp.cpp) lagom_tool(Generate_CSS_PropertyID_cpp SOURCES Generate_CSS_PropertyID_cpp.cpp)
add_executable(WrapperGenerator WrapperGenerator.cpp) lagom_tool(Generate_CSS_ValueID_h SOURCES Generate_CSS_ValueID_h.cpp)
lagom_tool(Generate_CSS_ValueID_cpp SOURCES Generate_CSS_ValueID_cpp.cpp)
lagom_tool(WrapperGenerator SOURCES WrapperGenerator.cpp)
target_compile_options(WrapperGenerator PUBLIC -g) target_compile_options(WrapperGenerator PUBLIC -g)
target_link_libraries(Generate_CSS_PropertyID_h LagomCore)
target_link_libraries(Generate_CSS_PropertyID_cpp LagomCore)
target_link_libraries(Generate_CSS_ValueID_h LagomCore)
target_link_libraries(Generate_CSS_ValueID_cpp LagomCore)
target_link_libraries(WrapperGenerator LagomCore)

View file

@ -2,5 +2,4 @@ set(SOURCES
main.cpp main.cpp
) )
add_executable(StateMachineGenerator ${SOURCES}) lagom_tool(StateMachineGenerator)
target_link_libraries(StateMachineGenerator LagomCore)

View file

@ -2,5 +2,4 @@ set(SOURCES
main.cpp main.cpp
) )
add_executable(ConfigureComponents ${SOURCES}) lagom_tool(ConfigureComponents)
target_link_libraries(ConfigureComponents LagomCore)