diff --git a/PythonAPI/CMakeLists.txt b/PythonAPI/CMakeLists.txt index 4cec22528..1cbc22b5e 100644 --- a/PythonAPI/CMakeLists.txt +++ b/PythonAPI/CMakeLists.txt @@ -36,6 +36,18 @@ set ( ${CMAKE_CURRENT_SOURCE_DIR}/carla ) +set ( + CARLA_PYTHON_API_CMAKE_ARGS + "\t'-G${CMAKE_GENERATOR}'" +) + +if (CMAKE_TOOLCHAIN_FILE) + set ( + CARLA_PYTHON_API_CMAKE_ARGS + "${CARLA_PYTHON_API_CMAKE_ARGS},\n\'\t--toolchain=${CMAKE_TOOLCHAIN_FILE}\'" + ) +endif () + carla_two_step_configure_file ( ${CARLA_PYTHON_API_CARLA_PATH}/pyproject.toml ${CARLA_PYTHON_API_CARLA_PATH}/pyproject.toml.in diff --git a/PythonAPI/carla/pyproject.toml.in b/PythonAPI/carla/pyproject.toml.in index 699cd7680..bac626edb 100644 --- a/PythonAPI/carla/pyproject.toml.in +++ b/PythonAPI/carla/pyproject.toml.in @@ -7,8 +7,10 @@ wheel.packages = ['carla'] cmake.version = '>=@CMAKE_MAJOR_VERSION@.@CMAKE_MINOR_VERSION@' cmake.build-type = '@CMAKE_BUILD_TYPE@' cmake.args = [ - '-DCMAKE_TOOLCHAIN_FILE=@CMAKE_TOOLCHAIN_FILE@' + @CARLA_PYTHON_API_CMAKE_ARGS@ ] +ninja.version=">=1.10" +ninja.make-fallback=true [project] name = 'carla'