Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/FindJemalloc.cmake
Show All 32 Lines | |||||
) | ) | ||||
set(Jemalloc_INCLUDE_DIRS ${Jemalloc_INCLUDE_DIR}) | set(Jemalloc_INCLUDE_DIRS ${Jemalloc_INCLUDE_DIR}) | ||||
mark_as_advanced(Jemalloc_INCLUDE_DIR) | mark_as_advanced(Jemalloc_INCLUDE_DIR) | ||||
if(Jemalloc_INCLUDE_DIR) | if(Jemalloc_INCLUDE_DIR) | ||||
include(ExternalLibraryHelper) | include(ExternalLibraryHelper) | ||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows") | |||||
set(THREADS_PREFER_PTHREAD_FLAG ON) | |||||
find_package(Threads REQUIRED) | |||||
endif() | |||||
deadalnix: IMO you might as well link it on windows as well, no? AFAIK, we will need the threading library… | |||||
FabienAuthorUnsubmitted Done Inline ActionsWindows don't need anything special like the -pthreads flag, so it's not strictly required, but it doesn't hurt either and make it a bit simpler. I'll change that. Fabien: Windows don't need anything special like the `-pthreads` flag, so it's not strictly required… | |||||
find_component(Jemalloc jemalloc | find_component(Jemalloc jemalloc | ||||
NAMES jemalloc | NAMES jemalloc_pic jemalloc | ||||
HINTS "${BREW_HINT}" | HINTS "${BREW_HINT}" | ||||
INCLUDE_DIRS ${Jemalloc_INCLUDE_DIRS} | INCLUDE_DIRS ${Jemalloc_INCLUDE_DIRS} | ||||
PATHS ${PC_Jemalloc_LIBRARY_DIRS} | PATHS ${PC_Jemalloc_LIBRARY_DIRS} | ||||
INTERFACE_LINK_LIBRARIES "$<$<NOT:$<PLATFORM_ID:Windows>>:dl;m;Threads::Threads>" | |||||
deadalnixUnsubmitted Not Done Inline ActionsIf we build the depends without dl, then we should not add it as a dependency. deadalnix: If we build the depends without dl, then we should not add it as a dependency. | |||||
FabienAuthorUnsubmitted Done Inline ActionsThis is OK for the version built from the depends, but not for other distributions that may have it as a dependency, such as debian. Fabien: This is OK for the version built from the depends, but not for other distributions that may… | |||||
) | ) | ||||
endif() | endif() | ||||
if(NOT Jemalloc_VERSION) | if(NOT Jemalloc_VERSION) | ||||
# If pkgconfig found a version number, use it. | # If pkgconfig found a version number, use it. | ||||
if(PC_Jemalloc_VERSION) | if(PC_Jemalloc_VERSION) | ||||
set(_Jemalloc_VERSION ${PC_Jemalloc_VERSION}) | set(_Jemalloc_VERSION ${PC_Jemalloc_VERSION}) | ||||
elseif(Jemalloc_INCLUDE_DIR) | elseif(Jemalloc_INCLUDE_DIR) | ||||
Show All 28 Lines |
IMO you might as well link it on windows as well, no? AFAIK, we will need the threading library on windows too to use jemalloc.