From c56cbf8027ee3b331049c31c5e01dcde0e72d020 Mon Sep 17 00:00:00 2001 From: demostanis Date: Fri, 2 Sep 2022 20:59:45 +0200 Subject: [PATCH] CMake: Quote all CMAKE_COMMAND occurences Building might fail if the cmake command path contains whitespace. See https://stackoverflow.com/a/35853080. --- CMakeLists.txt | 4 ++-- Kernel/CMakeLists.txt | 4 ++-- Userland/Libraries/LibC/CMakeLists.txt | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6f5f5a2062..3ce94fa769f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,12 +89,12 @@ add_custom_target(qemu-image USES_TERMINAL ) add_custom_target(grub-image - COMMAND ${CMAKE_COMMAND} -E env "SERENITY_SOURCE_DIR=${SerenityOS_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" "SERENITY_TOOLCHAIN=${CMAKE_CXX_COMPILER_ID}" "LLVM_VERSION=${CMAKE_CXX_COMPILER_VERSION}" "${SerenityOS_SOURCE_DIR}/Meta/build-image-grub.sh" + COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SerenityOS_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" "SERENITY_TOOLCHAIN=${CMAKE_CXX_COMPILER_ID}" "LLVM_VERSION=${CMAKE_CXX_COMPILER_VERSION}" "${SerenityOS_SOURCE_DIR}/Meta/build-image-grub.sh" BYPRODUCTS ${CMAKE_BINARY_DIR}/grub_disk_image USES_TERMINAL ) add_custom_target(limine-image - COMMAND ${CMAKE_COMMAND} -E env "SERENITY_SOURCE_DIR=${SerenityOS_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" "SERENITY_TOOLCHAIN=${CMAKE_CXX_COMPILER_ID}" "LLVM_VERSION=${CMAKE_CXX_COMPILER_VERSION}" "${SerenityOS_SOURCE_DIR}/Meta/build-image-limine.sh" + COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SerenityOS_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" "SERENITY_TOOLCHAIN=${CMAKE_CXX_COMPILER_ID}" "LLVM_VERSION=${CMAKE_CXX_COMPILER_VERSION}" "${SerenityOS_SOURCE_DIR}/Meta/build-image-limine.sh" BYPRODUCTS ${CMAKE_BINARY_DIR}/limine_disk_image USES_TERMINAL ) diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 872b994ff7e..100967d3380 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -672,8 +672,8 @@ endif() add_custom_command( TARGET Kernel POST_BUILD - COMMAND ${CMAKE_COMMAND} -E env NM=${CMAKE_NM} sh ${CMAKE_CURRENT_SOURCE_DIR}/mkmap.sh - COMMAND ${CMAKE_COMMAND} -E env OBJCOPY=${CMAKE_OBJCOPY} sh ${CMAKE_CURRENT_SOURCE_DIR}/embedmap.sh + COMMAND "${CMAKE_COMMAND}" -E env NM=${CMAKE_NM} sh ${CMAKE_CURRENT_SOURCE_DIR}/mkmap.sh + COMMAND "${CMAKE_COMMAND}" -E env OBJCOPY=${CMAKE_OBJCOPY} sh ${CMAKE_CURRENT_SOURCE_DIR}/embedmap.sh COMMAND ${CMAKE_OBJCOPY} --only-keep-debug Kernel Kernel.debug COMMAND ${CMAKE_OBJCOPY} --strip-debug Kernel COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=Kernel.debug Kernel diff --git a/Userland/Libraries/LibC/CMakeLists.txt b/Userland/Libraries/LibC/CMakeLists.txt index 159d4ae41e4..88906337b3f 100644 --- a/Userland/Libraries/LibC/CMakeLists.txt +++ b/Userland/Libraries/LibC/CMakeLists.txt @@ -107,27 +107,27 @@ add_library(crt0 STATIC crt0.cpp) target_link_libraries(crt0 PRIVATE NoCoverage) add_custom_command( TARGET crt0 - COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crt0.o + COMMAND "${CMAKE_COMMAND}" -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crt0.o ) add_library(crt0_shared STATIC crt0_shared.cpp) target_link_libraries(crt0_shared PRIVATE NoCoverage) add_custom_command( TARGET crt0_shared - COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crt0_shared.o + COMMAND "${CMAKE_COMMAND}" -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crt0_shared.o ) add_library(crti STATIC ${CRTI_SOURCE}) target_link_libraries(crti PRIVATE NoCoverage) add_custom_command( TARGET crti - COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crti.o + COMMAND "${CMAKE_COMMAND}" -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crti.o ) add_library(crtn STATIC ${CRTN_SOURCE}) target_link_libraries(crtn PRIVATE NoCoverage) add_custom_command( TARGET crtn - COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crtn.o + COMMAND "${CMAKE_COMMAND}" -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/crtn.o ) set_source_files_properties (ssp.cpp PROPERTIES COMPILE_FLAGS @@ -136,7 +136,7 @@ add_library(ssp STATIC ssp.cpp) target_link_libraries(ssp PRIVATE NoCoverage) add_custom_command( TARGET ssp - COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/ssp.o + COMMAND "${CMAKE_COMMAND}" -E copy $ ${CMAKE_INSTALL_PREFIX}/usr/lib/ssp.o ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libssp.a DESTINATION ${CMAKE_INSTALL_PREFIX}/usr/lib/)