Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- [embree3] fix clang-cl by converting resource to UTF-8 #9822

Merged
merged 2 commits into from
Mar 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for an additional safety, we may put it under if self.settings.compiler == "clang'. but I've checked, and Visual Studio builds just fine with it.

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)
os.remove(os.path.join(self._source_subfolder, "common", "cmake", "FindTBB.cmake"))
cmake = self._configure_cmake()
cmake.build()
Expand Down