Skip to content

Commit fadccab

Browse files
committed
build: Fix stub embedding language enablement
1 parent 229bd1d commit fadccab

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

cmake/Modules/VulkanSCPccUtilities.cmake

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
# ~~~
77

88
function(TARGET_EMBED_VKSC_ENVIRONMENT target)
9+
# NOTE: Due to CMP0165, enable_language() can only be reliably called after the project() declaration
10+
if(DEFINED PROJECT_NAME)
11+
message(FATAL_ERROR "Please include VulkanSCPccUtilities after your CMake project() declaration")
12+
endif()
13+
enable_language(CXX)
14+
915
set(EmbeddedEnviromentFileName "${CMAKE_CURRENT_BINARY_DIR}/DeviceFilterStub.cpp")
1016
set(EmbeddedEnvHelperClassName "SetEnvHelper_${target}")
1117

@@ -95,13 +101,6 @@ function(ADD_VKSC_PIPELINE_CACHE TARGET_NAME)
95101
if(ARG_OUT_IS_RELATIVE)
96102
cmake_path(ABSOLUTE_PATH ARG_OUT BASE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
97103
endif()
98-
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
99-
if(NOT CXX IN_LIST LANGUAGES)
100-
message(FATAL_ERROR
101-
"VulkanSC SDK CMake integration requires CXX language support be enabled. "
102-
"The VulkanSC package cannot reliably enable_language(CXX). For details, see CMP0165."
103-
)
104-
endif()
105104

106105
set(VulkanSC_PCC_DYNDEP_SCANNER "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/VulkanSCPcJsonDyndepScanner.cmake")
107106

0 commit comments

Comments
 (0)