Skip to content

Why forced static runtime on MSVC? #92

Closed

Description

@giumas

As in the title, I would like to understand the compelling reason to force a static runtime for the library (https://github.com/SRombauts/SQLiteCpp/blob/master/CMakeLists.txt#L24).

This is an issue for any project that wants to use SQLiteCpp, but also has to link to shared libraries (e.g., LGPL). Additional information in this SO answer: http://stackoverflow.com/a/4307551/2741329

I believe that a possible solution would be to adopt a CMake option similar to what gtest provides (i.e., gtest_force_shared_crt), so that user can decide the kind of runtime.
Incidentally, such an approach might also solve #53 without the need to add the export decorations as proposed in #57.

Activity

  1. SRombauts commented on Jul 18, 2016

    @SRombauts
    Owner

    You are right, static runtime is only required/recommended by googletest, so I should force it only in coordination with unit tests.

  2. self-assigned this
    on Jul 18, 2016
  3. added a commit that references this issue on Jul 19, 2016
  4. SRombauts commented on Jul 19, 2016

    @SRombauts
    Owner

    Hi @giumas, the fix I implemented is only the simplest option of all, that is, I know force the use of static runtime only when Unit Tests are enabled (which is OFF by default in the CMakeLists.txt).

    If this does not suit your needs, please let me know.

    Cheers!

  5. giumas commented on Jul 19, 2016

    @giumas
    Author

    The changes solved my issue, so I don't need anymore to tweak the library's CMake.

    Thank for having been so responsive!

  6. SRombauts commented on Jul 19, 2016

    @SRombauts
    Owner

    Nice!

    Also, you can propose any other changes as Pull Requests if you wish.

    Cheers

  7. SRombauts commented on Aug 18, 2023

    @SRombauts
    Owner

    CMakeFiles.txt updated to not force static runtime anymore #438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions