Skip to content

refactor: modernize CMake build system and improve portability#93

Open
abin-z wants to merge 5 commits into
martin-olivier:mainfrom
abin-z:main
Open

refactor: modernize CMake build system and improve portability#93
abin-z wants to merge 5 commits into
martin-olivier:mainfrom
abin-z:main

Conversation

@abin-z

@abin-z abin-z commented Apr 19, 2026

Copy link
Copy Markdown

Overview

This PR modernizes the CMake build system for the dylib project, improving maintainability, portability, and adherence to modern CMake best practices while remaining compatible with CMake 3.11.

Changes

  1. Modernized C++ standard handling
  • Replaced global CMAKE_CXX_STANDARD configuration
  • Enforced C++11 using target-based approach:
target_compile_features(dylib PUBLIC cxx_std_11)
  1. Migrated source definition to target-based model
  • Replaced set(SOURCES) + add_library(... ${SOURCES})
  • Adopted target_sources() for better modularity
  1. Improved platform portability for dynamic linking
  • Replaced direct dl linkage with CMake-provided variable:
target_link_libraries(dylib PRIVATE ${CMAKE_DL_LIBS})

Summary

This refactor aligns the project with modern CMake practices while maintaining strict compatibility with CMake 3.11 and preserving existing behavior.

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.

1 participant