Page 1 of 1

Windows, link with CRT DLL

PostPosted: Wed Dec 03, 2014 7:45 am
by alexeibs
I tried to follow instructions from https://code.google.com/p/chromiumembed ... eLibraries
but it didn't help me. libcef_dll_wrapper.lib still require static CRT. It looks like VS project settings just don't apply. How can I fix this?
I'm building CEF 2171 with Chromium tag 39.0.2171.65

Re: Windows, link with CRT DLL

PostPosted: Mon Dec 08, 2014 9:50 am
by alexeibs
As I understood instructions from CEF wiki are relevant to the CEF binary distributions only. But I'm building CEF from sources so that's not working for me. I solved the problem by manual editing of the gyp project file. First I run 'ninja -C out\Debug cefclient cef_unittests'. Then I manually edited libcef_dll_wrapper.ninja and replaced /MTd flag with /MDd flag. Then I launched 'ninja -C out\Debug libcef_dll_wrapper'. It worked.
Then I added new configuration 'libcef_dll_wrapper_md' into cef.gyp:
Code: Select all
    {
      'target_name': 'libcef_dll_wrapper_md',
      'type': 'static_library',
      'msvs_guid': '3DD56D0D-425F-40EE-8704-751D94737AE8',
      'defines': [
        'USING_CEF_SHARED',
      ],
      'include_dirs': [
        '.',
      ],
      'sources': [
        '<@(includes_common)',
        '<@(includes_capi)',
        '<@(includes_wrapper)',
        '<@(libcef_dll_wrapper_sources_common)',
      ],
      'dependencies': [
        'libcef',
      ],
      'configurations': {
        'Debug_Base': {
          'msvs_settings': {
            'VCCLCompilerTool': {
              'RuntimeLibrary': '3' # MultiThreadedDebugDLL
            },
          },
        },
        'Release_Base': {
          'msvs_settings': {
            'VCCLCompilerTool': {
              'RuntimeLibrary': '2' # MultiThreadedDLL
            },
          },
        },
      },
    },

This allows me to build all targets by singe command 'ninja -C out\Debug cefclient cef_unittests libcef_dll_wrapper_md' without manual editing of .ninja file