Skip to content

Build as dll #57

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

Closed
wants to merge 4 commits into from
Closed

Build as dll #57

wants to merge 4 commits into from

Conversation

aurelien35
Copy link

I've made following changes :

  • added SQLiteCppExport.h header which contains DLL import / export directive for Windows and Linux
  • added the SQLITECPP_DLL macro on all symbols to be exported
  • modified the CMakeList file to add new options

There is 3 new preprocessor "DEFINE" symbols :

  • SQLITECPP_DYNAMIC :
    => if defined, this mean SQLiteCpp is being build/used as a dynamic library
  • SQLITECPP_EXPORT:
    => if defined, this mean SQLiteCpp is being BUILD as a dynamic library, and it will EXPORT its symbols
    => if not defined, this mean SQLiteCpp is being USED as a dynamic library, and it will IMPORT its symbols
  • SQLITECPP_DISABLE_MSVC_DLL_WARNINGS :
    => if defined, this mean Visual Studio should ignore the DLL export warnings about STL classes. You can ignore that when you build all your solution with the same runtime library. (if you don't do that, you will have very bad time anyway)

I'm not an expert in CMake files, and there is still something to fix in the actual file : the "SQLITECPP_EXPORT" is defined when a dynamic library build is asked, but even to build the example.

The example should not define this symbol because it need to IMPORT the code, not export it.

My guess is a subdirectory with a specific configuration is needed for every target : SQLite3, SQLiteCpp and Example

@SRombauts
Copy link
Owner

Yes, you are right on your assumption that every target would need a specific CMakeLists.txt in its subdirectory.

I'll try to take the time to review this.

@SRombauts
Copy link
Owner

Closing this as it would need more work that I afford

@SRombauts
Copy link
Owner

This was implemented long after by #406

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

Successfully merging this pull request may close these issues.

2 participants