Skip to content

Commit

Permalink
- [embree3] fix clang-cl by converting resource to UTF-8
Browse files Browse the repository at this point in the history
Signed-off-by: SSE4 <tomskside@gmail.com>
  • Loading branch information
SSE4 committed Mar 17, 2022
1 parent 1f93dc2 commit a26b415
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions recipes/embree3/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
from conan.tools.files import save, load
import glob
import os
import textwrap
Expand Down Expand Up @@ -170,6 +171,13 @@ def _configure_cmake(self):
return self._cmake

def build(self):
# some compilers (e.g. clang) do not like UTF-16 sources
rc = os.path.join(self._source_subfolder, "kernels", "embree.rc")
content = load(self, rc, encoding="utf_16_le")
if content[0] == '\ufeff':
content = content[1:]
content = "#pragma code_page(65001)\n" + content
save(self, rc, content, encoding="utf8")
os.remove(os.path.join(self._source_subfolder, "common", "cmake", "FindTBB.cmake"))
cmake = self._configure_cmake()
cmake.build()
Expand Down

0 comments on commit a26b415

Please sign in to comment.