Skip to content

Commit

Permalink
Fix for cmake policy CMP0148 (google#1382)
Browse files Browse the repository at this point in the history
* Fix cmake policy CMP0148

* Fix cmake policy CMP0148 on CMakeLists.txt
  • Loading branch information
stuart6854 authored and artdeell committed Dec 29, 2023
1 parent 32d6256 commit 04c5efd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ if (COMPILER_SUPPORTS_EXTRA_SEMI_WARNING)
add_compile_options("-Wextra-semi")
endif()

find_host_package(PythonInterp 3 REQUIRED)
if(${CMAKE_VERSION} VERSION_LESS_EQUAL "3.12")
find_package(PythonInterp 3 REQUIRED)
else ()
find_package(Python COMPONENTS Interpreter REQUIRED)
endif ()

if (SHADERC_ENABLE_COPYRIGHT_CHECK)
add_custom_target(check-copyright ALL
Expand Down
6 changes: 5 additions & 1 deletion cmake/setup_build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ if (ANDROID)
find_host_package(PythonInterp 3 REQUIRED)
find_host_package(BISON)
else()
find_package(PythonInterp 3 REQUIRED)
if(${CMAKE_VERSION} VERSION_LESS_EQUAL "3.12")
find_package(PythonInterp 3 REQUIRED)
else ()
find_package(Python COMPONENTS Interpreter REQUIRED)
endif ()
endif()

option(DISABLE_RTTI "Disable RTTI in builds")
Expand Down

0 comments on commit 04c5efd

Please sign in to comment.