Cleanup: correct indentation for CMake files, strip trailing space

This commit is contained in:
Campbell Barton 2025-01-03 13:23:38 +11:00
parent 72a9990779
commit 33e38c605f
60 changed files with 293 additions and 275 deletions

View file

@ -17,7 +17,8 @@ endif()
# an Xcode or Command Line Tools installation.
execute_process(
COMMAND xcode-select --print-path
OUTPUT_VARIABLE XCODE_DEVELOPER_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_VARIABLE XCODE_DEVELOPER_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Detect Xcode version. It is provided by the Xcode generator but not
# Unix Makefiles or Ninja.
@ -57,7 +58,8 @@ if(XCODE_VERSION)
execute_process(
COMMAND xcodebuild -version -sdk macosx SDKVersion
OUTPUT_VARIABLE OSX_SYSTEM
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
message(STATUS "Detected OS X ${OSX_SYSTEM} and Xcode ${XCODE_VERSION} at ${XCODE_DEVELOPER_DIR}")
@ -69,7 +71,8 @@ else()
OUTPUT_VARIABLE _cltools_pkg_info
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE _cltools_pkg_info_result
ERROR_QUIET)
ERROR_QUIET
)
if(_cltools_pkg_info_result EQUAL 0)
# Extract version.
@ -82,7 +85,8 @@ else()
execute_process(
COMMAND xcrun --sdk macosx --show-sdk-version
OUTPUT_VARIABLE OSX_SYSTEM
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
message(STATUS "Detected OS X ${OSX_SYSTEM} and Command Line Tools ${XCODE_VERSION} at ${XCODE_DEVELOPER_DIR}")

View file

@ -7,6 +7,7 @@ remove_strict_flags()
if(CMAKE_COMPILER_IS_GNUCC)
remove_cc_flag("-Wunused-macros")
endif()
set(INC
.
)

View file

@ -553,7 +553,8 @@ if(WITH_CYCLES_CUDA_BINARIES)
${CUDA_NVCC_FLAGS}
--${format}
${CMAKE_CURRENT_SOURCE_DIR}${cuda_kernel_src}
${cuda_flags})
${cuda_flags}
)
if(WITH_COMPILER_CCACHE AND CCACHE_PROGRAM)
add_custom_command(
@ -829,7 +830,8 @@ if(WITH_CYCLES_DEVICE_HIPRT)
${SRC_KERNEL_HEADERS}
${SRC_KERNEL_DEVICE_GPU_HEADERS}
${SRC_KERNEL_DEVICE_HIPRT_HEADERS}
${SRC_UTIL_HEADERS})
${SRC_UTIL_HEADERS}
)
set(cycles_bitcode_file ${CMAKE_CURRENT_BINARY_DIR}/kernel_rt_gfx.bc)
set(sdk_bitcode_file ${CMAKE_CURRENT_BINARY_DIR}/hiprt${HIPRT_VERSION}_${HIP_VERSION_SHORT}_amd_lib.bc)
@ -880,22 +882,26 @@ if(WITH_CYCLES_DEVICE_HIPRT)
-Wno-parentheses-equality
-Wno-unused-value
-ffast-math
-o ${cycles_bitcode_file})
-o ${cycles_bitcode_file}
)
add_custom_command(
OUTPUT ${cycles_bitcode_file}
COMMAND ${hiprt_compile_command} ${hiprt_compile_flags_cycles_bc}
DEPENDS ${kernel_sources})
DEPENDS ${kernel_sources}
)
add_custom_command(
OUTPUT ${sdk_bitcode_file}
COMMAND ${hiprt_compile_command} ${hiprt_compile_flags_sdk_bc}
DEPENDS ${HIPRT_INCLUDE_DIR}/hiprt/impl/hiprt_kernels_bitcode.h)
DEPENDS ${HIPRT_INCLUDE_DIR}/hiprt/impl/hiprt_kernels_bitcode.h
)
if(WIN32)
set(hiprt_link_command ${CMAKE_COMMAND})
set(hiprt_link_flags -E env "HIP_PATH=${HIP_ROOT_DIR}"
${HIP_LINKER_EXECUTABLE})
${HIP_LINKER_EXECUTABLE}
)
else()
set(hiprt_link_command ${HIP_LINKER_EXECUTABLE})
set(hiprt_link_flags)
@ -910,17 +916,20 @@ if(WITH_CYCLES_DEVICE_HIPRT)
-parallel-jobs=${HIPRT_COMPILER_PARALLEL_JOBS}
${cycles_bitcode_file}
${sdk_bitcode_file}
-o ${hiprt_file})
-o ${hiprt_file}
)
add_custom_command(
OUTPUT ${hiprt_file}
COMMAND ${hiprt_link_command} ${hiprt_link_flags}
DEPENDS ${cycles_bitcode_file} ${sdk_bitcode_file})
DEPENDS ${cycles_bitcode_file} ${sdk_bitcode_file}
)
add_custom_command(
OUTPUT ${hiprt_file_compressed}
COMMAND "$<TARGET_FILE:zstd_compress>" ${hiprt_file} ${hiprt_file_compressed}
DEPENDS ${hiprt_file})
DEPENDS ${hiprt_file}
)
delayed_install("${CMAKE_CURRENT_BINARY_DIR}" "${hiprt_file_compressed}" ${CYCLES_INSTALL_PATH}/lib)
endif()
@ -980,7 +989,8 @@ if(WITH_CYCLES_DEVICE_OPTIX AND WITH_CYCLES_CUDA_BINARIES)
${cuda_flags}
${input}
WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}")
"${CMAKE_CURRENT_SOURCE_DIR}"
)
add_custom_command(
OUTPUT ${output_compressed}
@ -1293,7 +1303,8 @@ if(WITH_CYCLES_DEVICE_ONEAPI)
string(REPLACE " " ";" sycl_compiler_flags_Debug_str ${sycl_compiler_flags_Debug_str})
add_custom_command(
OUTPUT ${cycles_kernel_oneapi_lib}
COMMAND ${CMAKE_COMMAND} -E env
COMMAND
${CMAKE_COMMAND} -E env
"LD_LIBRARY_PATH=${sycl_compiler_root}/../lib:${OCLOC_INSTALL_DIR}/lib:${IGC_INSTALL_DIR}/lib"
# `$ENV{PATH}` is for compiler to find `ld`.
"PATH=${OCLOC_INSTALL_DIR}/bin:${sycl_compiler_root}:$ENV{PATH}"

View file

@ -547,14 +547,16 @@ endif()
if(WIN32)
if(EXISTS ${LIBDIR}/osl/bin/oslquery.dll) # 4.1+
windows_install_shared_manifest(
FILES ${LIBDIR}/osl/bin/oslquery.dll
FILES
${LIBDIR}/osl/bin/oslquery.dll
${LIBDIR}/osl/bin/oslcomp.dll
${LIBDIR}/osl/bin/oslexec.dll
${LIBDIR}/osl/bin/oslnoise.dll
RELEASE
)
windows_install_shared_manifest(
FILES ${LIBDIR}/osl/bin/oslquery_d.dll
FILES
${LIBDIR}/osl/bin/oslquery_d.dll
${LIBDIR}/osl/bin/oslcomp_d.dll
${LIBDIR}/osl/bin/oslexec_d.dll
${LIBDIR}/osl/bin/oslnoise_d.dll