Skip to content

Commit

Permalink
(#20520) jinja2cpp: fix JINJA2CPP_CXX_STANDARD mapping with `compil…
Browse files Browse the repository at this point in the history
…er.cppstd` when cppstd is `gnu*`

* fix JINJA2CPP_CXX_STANDARD mapping with compiler.cppstd when cppstd is `gnu*`

* remove unused import
  • Loading branch information
SpaceIm authored Oct 15, 2023
1 parent 34b149f commit 3e1a99d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions recipes/jinja2cpp/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.microsoft import msvc_runtime_flag, is_msvc
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, replace_in_file
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, replace_in_file
from conan.tools.build import check_min_cppstd
from conan.tools.scm import Version
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
Expand Down Expand Up @@ -86,7 +86,9 @@ def generate(self):
tc.variables["JINJA2CPP_STRICT_WARNINGS"] = False
tc.variables["JINJA2CPP_BUILD_SHARED"] = self.options.shared
tc.variables["JINJA2CPP_DEPS_MODE"] = "conan-build"
tc.variables["JINJA2CPP_CXX_STANDARD"] = self.settings.compiler.get_safe("cppstd", 14)
cppstd = self.settings.compiler.get_safe("cppstd")
if cppstd:
tc.cache_variables["JINJA2CPP_CXX_STANDARD"] = str(cppstd).replace("gnu", "")
if is_msvc(self):
# Runtime type configuration for Jinja2C++ should be strictly '/MT' or '/MD'
runtime = "/MD" if "MD" in msvc_runtime_flag(self) else "/MT"
Expand Down

0 comments on commit 3e1a99d

Please sign in to comment.