Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Adding optional configuration for building as a shared library vs static?

Open
#51 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cmake, cpp
Domain
build-system

Research direction

Start by locating the CMake configuration containing the GDeflate add_library definition, then inspect 3rdparty/libdeflate.cmake. Configure the project with BUILD_SHARED_LIBS enabled and disabled, and verify that both configurations produce the intended library types without requiring manual edits.

Written by the indexing model from the issue text.

Description

enhancement

I needed to build a shared library version of GDeflate to satisfy a dependency, but currently the CMake configuration only builds a static version. I was able to fix this by replacing

add_library(GDeflate STATIC ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})

with

if(BUILD_SHARED_LIBS)
    add_library(GDeflate SHARED ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
else()
    add_library(GDeflate STATIC ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
endif()

I also had to change this in 3rdparty/libdeflate.cmake, ending up with two shared libraries. It's a small change but I wanted to propose a PR for it in case it would be useful for anyone else? Let me know what you think.

Dominant language
C++
Stars
897
Forks
111
Avg merge
13h 58m
Merged PRs (30d)
12

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/DirectStorage

All issues in microsoft/DirectStorage

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.