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

adding compiler flag for windows / MSVC #60

Closed
dothebart opened this issue Oct 28, 2019 · 4 comments
Closed

adding compiler flag for windows / MSVC #60

dothebart opened this issue Oct 28, 2019 · 4 comments

Comments

@dothebart
Copy link

to permit compiling umlaut chars like:

auto a = u'ü';

MSVC needs to be set the commandline switch

/UTF-8

I fail to work my way through the msbuild generator how I'd best achieve this; Anybody got a hint for me on this?

@dothebart
Copy link
Author

dothebart commented Nov 8, 2019

ok, it seems one should add it in the standalone gyppi:

        'msvs_settings': {
          'VCCLCompilerTool': {
            'MinimalRebuild': 'false',
            'BufferSecurityCheck': 'true',
            'EnableFunctionLevelLinking': 'true',
            'RuntimeTypeInfo': 'false',
            'WarningLevel': '3',
            'WarnAsError': 'true',
            'Detect64BitPortabilityProblems': 'false',
            'conditions': [
              ['use_clcache_mode=="true"', {
                'DebugInformationFormat': '1',
              }, {
                'DebugInformationFormat': '3',
              }],
              [ 'msvs_multi_core_compile', {
                'AdditionalOptions': ['/MP', '/utf-8'],
              }],
              ['component=="shared_library"', {
                'ExceptionHandling': '1',  # /EHsc
              }, {
                'ExceptionHandling': '0',
              }],
            ],

now a full ICU will compile with the V8 gyp files.

Reveresd by editing with MSVS as requested in https://docs.microsoft.com/en-us/cpp/build/reference/utf-8-set-source-and-executable-character-sets-to-utf-8?view=vs-2019 - and fiddling with gyp to produce a similar file.

@guinzoo
Copy link

guinzoo commented Nov 8, 2019

Sorry for being late, but the easiest way is to add to target this option:

'msvs_configuration_attributes': {
  'CharacterSet': '1'
},

@dothebart
Copy link
Author

hm, thats already there, and even adding it to the icu.gyp doesn't do the trick - still

third_party\icu\source\common\static_unicode_sets.h(133): error C2015: too many characters in constant (compiling source file third_party\icu\source\i18n\scientificnumberformatter.cpp) 

@dothebart
Copy link
Author

@guinzoo I guess your switch does something else. this /utf-8 switch is about

auto foo = 'ü';

producing an error with MSVC or not.
CharacterSet will probably switch which encoding is in comments and strings.
Anyways, for me this is fixed now, so I'll close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants