glbinding icon indicating copy to clipboard operation
glbinding copied to clipboard

Bloated build directory with CMake on macOS

Open julcst opened this issue 1 year ago • 0 comments

In my CMake project I download and build glbinding as a dependency with FetchContent:

include(FetchContent)

FetchContent_Declare(
    glbinding
    #GIT_REPOSITORY https://github.com/cginternals/glbinding.git
    GIT_TAG v3.3.0
    URL https://github.com/cginternals/glbinding/archive/v3.3.0.tar.gz
    EXCLUDE_FROM_ALL
)
set(OPTION_BUILD_TOOLS OFF CACHE BOOL "" FORCE)
set(OPTION_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)

This works but generates a huge build folder build/_deps/glbinding-build (160-200 MB in Debug mode 45 MB in Release mode) This massive amount of data sits inside build/_deps/glbinding-build/source/glbinding/CMakeFiles/glbinding.dir/source and build/_deps/glbinding-build/source/glbinding-aux/CMakeFiles/glbinding-aux.dir/source in form of really big .o and .o.d files: glbinding-debug-mode Can I do anything to reduce the build size as permanently setting Release mode is not a real option?

I also tried setting

set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE)

and

set(OPTION_BUILD_WITH_LTO ON CACHE BOOL "" FORCE)

but these options had no significant effect.

My compiler is Clang 15.0.0 arm64-apple-darwin23.5.0

julcst avatar Jun 26 '24 20:06 julcst