Skip to content

Visual Studio 2015: add an option to use static or DLL C Runtime library for Uri submodule #686

@enricodetoma

Description

@enricodetoma

In your main Uri repository you have this option:

option(Uri_USE_STATIC_CRT` "Use static C Runtime library (/MT or MTd)." ON)
...
if (MSVC)
  if (Uri_USE_STATIC_CRT)
    # Replace dynamic MSVCRT linker flags with static version.
    foreach(flag_var
        CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
        CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
      if(${flag_var} MATCHES "/MD")
        string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
      endif(${flag_var} MATCHES "/MD")
    endforeach(flag_var)
  endif(Uri_USE_STATIC_CRT)

Can you please port it to the deps/uri submodule here?
I don't know how to submit a pull request on a submodule, otherwise I would make a pull request myself.
One needs to be able to choose whether to link with the static or DLL C Runtime library for MSVC.
Also, if possible, the default should be OFF (DLL C Runtime Library), because I guess it's the most common option (and it's the default for cpp-netlib itself).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions