Skip to content

Commit

Permalink
Make jemalloc configure command nicer
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Feb 15, 2022
1 parent 3604a7f commit 6be4c5d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions external/jemalloc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ endif()
include(ExternalProject)
ExternalProject_Add(jemalloc
URL ${third_party_loc}/jemalloc
CONFIGURE_COMMAND cd "<SOURCE_DIR>" && export EXTRA_CFLAGS=-fstack-protector-all\ -fPIC\ -D_FORTIFY_SOURCE=2 && export EXTRA_CXXFLAGS=-fstack-protector-all\ -fPIC\ -D_FORTIFY_SOURCE=2 && CC=clang CXX=clang++ ./autogen.sh
CONFIGURE_COMMAND env
CC=clang
CXX=clang++
"EXTRA_CFLAGS=-fstack-protector-all -D_FORTIFY_SOURCE=2"
"EXTRA_CXXFLAGS=-fstack-protector-all -D_FORTIFY_SOURCE=2"
./autogen.sh --disable-shared
BUILD_IN_SOURCE 1
STEP_TARGETS build
EXCLUDE_FROM_ALL TRUE
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libjemalloc.a
BUILD_BYPRODUCTS <SOURCE_DIR>/lib/libjemalloc_pic.a
)

ExternalProject_Get_property(jemalloc SOURCE_DIR)
Expand All @@ -50,7 +55,7 @@ INTERFACE

target_link_libraries(external_jemalloc
INTERFACE
-Wl,--push-state,--whole-archive,${SOURCE_DIR}/lib/libjemalloc.a,--pop-state,-ldl
-Wl,--push-state,--whole-archive,${SOURCE_DIR}/lib/libjemalloc_pic.a,--pop-state,-ldl
)

add_dependencies(external_jemalloc jemalloc-build)

0 comments on commit 6be4c5d

Please sign in to comment.