hrydgard / minitrace

Simple C/C++ library for producing JSON traces suitable for Chrome's built-in trace viewer (about:tracing).
MIT License
373 stars 64 forks source link

Allow building minitrace as a shared library #36

Closed JuliusBrueggemann closed 1 year ago

JuliusBrueggemann commented 1 year ago

This PR allows users to build minitrace as a shared library via CMake by setting the option MTR_BUILD_SHARED to ON. This option defaults to the value of BUILD_SHARED_LIBS.

Closes #35

hrydgard commented 1 year ago

Hm, I'd be concerned about breakage for people who don't use cmake. Can we do something like have an ifdef around the minitrace_export include, and in the else path, set MINITRACE_EXPORT to "", or similar?

JuliusBrueggemann commented 1 year ago

Hm, I'd be concerned about breakage for people who don't use cmake. Can we do something like have an ifdef around the minitrace_export include, and in the else path, set MINITRACE_EXPORT to "", or similar?

I just pushed a change that should do exactly that.

hrydgard commented 1 year ago

Looks like that will take care of it, yeah!