fix cmake
cherry-picked from: qt-wgpu-skel:9f5e52277a79a5bddf6e4223d9c4f0e29c1f633c
This commit is contained in:
parent
77c0a06053
commit
e37270324b
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.18)
|
||||
cmake_minimum_required(VERSION 3.18...4.2)
|
||||
|
||||
project(photon-light VERSION 1.0.0 LANGUAGES CXX)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,24 @@
|
|||
# build the Rust side as a static library
|
||||
set(impl_basename "${CARGO_TARGET_DIR}/release/libphoton_light_impl")
|
||||
|
||||
set(cargo_cmake_args)
|
||||
|
||||
if("${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.27")
|
||||
list(APPEND cargo_cmake_args DEPENDS_EXPLICIT_ONLY)
|
||||
endif()
|
||||
|
||||
if("${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.28")
|
||||
list(APPEND cargo_cmake_args JOB_SERVER_AWARE TRUE)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${impl_basename}.a
|
||||
COMMAND env CARGO_TARGET_DIR=${CARGO_TARGET_DIR} ${CARGO} build --release --package photon-light-impl
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPFILE ${impl_basename}.d
|
||||
USES_TERMINAL
|
||||
JOB_SERVER_AWARE
|
||||
DEPENDS_EXPLICIT_ONLY
|
||||
VERBATIM
|
||||
${cargo_cmake_args}
|
||||
)
|
||||
|
||||
# HACK ensure CMake *actually adds* the command above
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user