Skip to content

Compile CpuMathNative and FastTreeNative with charset=utf-8 on Windows #187

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

Merged
merged 1 commit into from
May 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include_directories("${CMAKE_BINARY_DIR}/../../")
if(WIN32)
add_definitions(-DWIN32)
add_definitions(-D_WIN32=1)
add_definitions(-DUNICODE -D_UNICODE)
Copy link
Member

Choose a reason for hiding this comment

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

Looking at

https://github.com/dotnet/coreclr/blob/7b41d8d938760c2e5d54d2e699a5bbb78cd3502a/clrdefinitions.cmake#L229-L230
and
https://github.com/dotnet/coreclr/blob/b82063e24b34c875891916a1bbc01728b9022bf3/src/vm/CMakeLists.txt#L7

It looks like these options are set for all platforms in coreclr. So maybe we should be setting them for all platforms as well?

/cc @janvorli @jkotas - any thoughts?

It doesn't appear that we are setting these options at all in the corefx or core-setup repos.

Copy link
Member

@jkotas jkotas May 18, 2018

Choose a reason for hiding this comment

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

I do not think you want to set these for this project on Unix.

CoreCLR is built with Win32 PAL that is a custom Windows API emulator. You will find a lot of Windowsisms in Unix CoreCLR build because of that. UNICODE define is one of them.

If you want to look at prior art, CoreRT build is better example. It is setup as clean x-plat project. You can see that it defines UNICODE on Windows only: https://github.com/dotnet/corert/blob/master/src/Native/CMakeLists.txt#L185

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the info, @jkotas.

if(IS_64BIT_BUILD)
add_definitions(-D_WIN64=1)
endif()
Expand Down