1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

CMake: Replace bespoke utility name mangling logic

Instead of manually removing the '.cpp' extension, we can simply ask
CMake to give us the file name without the last extension.
This commit is contained in:
implicitfield 2024-02-26 17:45:28 +04:00 committed by Andrew Kaster
parent 0dca6990b3
commit e91f60e0f5

View file

@ -14,8 +14,7 @@ list(APPEND RECOMMENDED_TARGETS
# FIXME: Support specifying component dependencies for utilities (e.g. WebSocket for telws)
foreach(CMD_SRC ${CMD_SOURCES})
get_filename_component(CMD_NAME_WITH_EXTENSION ${CMD_SRC} NAME)
string(REPLACE ".cpp" "" CMD_NAME ${CMD_NAME_WITH_EXTENSION})
get_filename_component(CMD_NAME ${CMD_SRC} NAME_WLE)
if (CMD_NAME IN_LIST SPECIAL_TARGETS)
set(TARGET_NAME "${CMD_NAME}-bin")
else()