Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-alugrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-alugrid
Commits
c2badb4c
Commit
c2badb4c
authored
9 years ago
by
Robert K
Browse files
Options
Downloads
Patches
Plain Diff
[bugfix] fix DLMalloc check that was broke after rerun of cmake.
parent
943e79da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/modules/FindDLMalloc.cmake
+26
-23
26 additions, 23 deletions
cmake/modules/FindDLMalloc.cmake
with
26 additions
and
23 deletions
cmake/modules/FindDLMalloc.cmake
+
26
−
23
View file @
c2badb4c
...
...
@@ -12,30 +12,37 @@
set
(
DLMALLOC_ROOT
""
CACHE PATH
"Path list to search for DLMALLOC"
)
mark_as_advanced
(
DLMALLOC_ROOT
)
#message("dlmalloc: ${DLMALLOC_ROOT}")
#look for header files at positions given by the user
find_path
(
DLMALLOC_INCLUDE_DIR malloc.c
PATHS
${
DLMALLOC_DIR
}
${
DLMALLOC_ROOT
}
NO_DEFAULT_PATH
)
IF
(
DLMALLOC_INCLUDE_DIR
)
# unset DLMALLOC_SOURCE_USABLE to force a rerun of CHECK_C_SOURCE_COMPILES
unset
(
DLMALLOC_SOURCE_USABLE CACHE
)
if
(
DLMALLOC_INCLUDE_DIR
)
set
(
DLMALLOC_SOURCE_INCLUDE
"
\"
${
DLMALLOC_INCLUDE_DIR
}
/malloc.c
\"
"
)
ELSE
()
#look for header files at positions given by the user
find_path
(
DLMALLOC_INCLUDE_DIR malloc-2.8.6.c
PATHS
${
DLMALLOC_DIR
}
${
DLMALLOC_ROOT
}
NO_DEFAULT_PATH
)
IF
(
DLMALLOC_INCLUDE_DIR
)
set
(
DLMALLOC_SOURCE_INCLUDE
"
\"
${
DLMALLOC_INCLUDE_DIR
}
/malloc-2.8.6.c
\"
"
)
ENDIF
()
ENDIF
()
# check if dlmalloc can be compiled
CHECK_C_SOURCE_COMPILES
(
"#include
${
DLMALLOC_SOURCE_INCLUDE
}
int main () { return 0; }"
DLMALLOC_SOURCE_USABLE
)
# check if dlmalloc can be compiled
CHECK_C_SOURCE_COMPILES
(
"#include
${
DLMALLOC_SOURCE_INCLUDE
}
int main () { return 0; }"
DLMALLOC_SOURCE_USABLE
)
endif
()
if
(
NOT DLMALLOC_SOURCE_USABLE
)
unset
(
DLMALLOC_SOURCE_USABLE CACHE
)
#look for header files at positions given by the user
find_path
(
DLMALLOC_INCLUDE_DIR malloc-2.8.6.c
PATHS
${
DLMALLOC_DIR
}
${
DLMALLOC_ROOT
}
NO_DEFAULT_PATH
)
if
(
DLMALLOC_INCLUDE_DIR
)
set
(
DLMALLOC_SOURCE_INCLUDE
"
\"
${
DLMALLOC_INCLUDE_DIR
}
/malloc-2.8.6.c
\"
"
)
# check if dlmalloc can be compiled
CHECK_C_SOURCE_COMPILES
(
"#include
${
DLMALLOC_SOURCE_INCLUDE
}
int main () { return 0; }"
DLMALLOC_SOURCE_USABLE
)
else
()
unset
(
DLMALLOC_SOURCE_USABLE CACHE
)
endif
()
endif
()
# behave like a CMake module is supposed to behave
...
...
@@ -44,7 +51,7 @@ find_package_handle_standard_args(
"DLMalloc"
DEFAULT_MSG
DLMALLOC_INCLUDE_DIR
DLMALLOC_SOURCE_
USABL
E
DLMALLOC_SOURCE_
INCLUD
E
)
mark_as_advanced
(
DLMALLOC_INCLUDE_DIR
)
...
...
@@ -52,12 +59,8 @@ mark_as_advanced(DLMALLOC_INCLUDE_DIR)
# if found, store some results
if
(
DLMALLOC_FOUND
)
message
(
STATUS
"
${
DLMALLOC_SOURCE_INCLUDE
}
found."
)
set
(
DLMALLOC_SOURCE_INCLUDE CACHE STRING
${
DLMALLOC_SOURCE_INCLUDE
}
)
endif
(
DLMALLOC_FOUND
)
#set HAVE_DLMALLOC for config.h
set
(
HAVE_DLMALLOC
${
DLMALLOC_FOUND
}
)
# register package
if
(
DLMALLOC_FOUND
)
dune_register_package_flags
(
INCLUDE_DIRS
${
DLMALLOC_SOURCE_INCLUDE
}
)
endif
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment