Skip to content

Commit

Permalink
spirv-tools requires C++17 since 1.3.243.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceIm committed Apr 10, 2023
1 parent cfcec90 commit 56c69bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion recipes/spirv-tools/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class SpirvtoolsConan(ConanFile):

short_paths = True

@property
def _min_cppstd(self):
return "11" if Version(self.version) < "1.3.243" else "17"

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand All @@ -49,7 +53,7 @@ def requirements(self):

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)
check_min_cppstd(self, self._min_cppstd)

def _cmake_new_enough(self, required_version):
try:
Expand Down
6 changes: 5 additions & 1 deletion recipes/spirv-tools/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ endif()
if(TARGET SPIRV-Tools-opt)
add_executable(${PROJECT_NAME}_cpp test_package.cpp)
target_link_libraries(${PROJECT_NAME}_cpp PRIVATE SPIRV-Tools-opt)
target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11)
if(SPIRV-Tools_VERSION VERSION_LESS "1.3.243.0")
target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_11)
else()
target_compile_features(${PROJECT_NAME}_cpp PRIVATE cxx_std_17)
endif()
endif()

0 comments on commit 56c69bc

Please sign in to comment.