Skip to content

Commit

Permalink
Minimise build on snmalloc.
Browse files Browse the repository at this point in the history
The `EXCLUDE_FROM_ALL` target on `add_subdirectory` means that it will only build items that are required to build other targets.  This means that it will not build the `memcpy` version that you are not using in this project, hence remove the issue with FORTIFY_SOURCE. This should also mildly improve your build times.
  • Loading branch information
mjp41 authored and jcelerier committed Jan 21, 2025
1 parent 9024e67 commit 7f679f8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions 3rdparty/mimalloc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ if(SCORE_HAS_SANITIZERS)
return()
endif()

if("${CMAKE_CXX_FLAGS}" MATCHES ".*_FORTIFY_SOURCE.*")
return()
endif()
if("${CMAKE_CXX_FLAGS}" MATCHES ".*_GLIBCXX_ASSERTIONS.*")
return()
endif()
Expand All @@ -24,6 +21,6 @@ else()
set(SNMALLOC_BUILD_TESTING
OFF
CACHE INTERNAL "" FORCE)
add_subdirectory(3rdparty/snmalloc SYSTEM)
add_subdirectory(3rdparty/snmalloc EXCLUDE_FROM_ALL SYSTEM)
endblock()
endif()

0 comments on commit 7f679f8

Please sign in to comment.