Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
glog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
glog
Commits
85e5c6ed
Commit
85e5c6ed
authored
Aug 12, 2015
by
Fumitoshi Ukai
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #47 from sergiud/master
Allow to disable multithreading support using CMake
parents
4dd62b05
cb5487d9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
CMakeLists.txt
CMakeLists.txt
+10
-9
config.h.cmake.in
src/config.h.cmake.in
+3
-0
No files found.
CMakeLists.txt
View file @
85e5c6ed
...
...
@@ -23,6 +23,7 @@ set (CPACK_PACKAGE_VERSION_PATCH ${GLOG_PATCH_VERSION})
set
(
CPACK_PACKAGE_VERSION
${
GLOG_VERSION
}
)
option
(
WITH_GFLAGS
"Use gflags"
ON
)
option
(
WITH_THREADS
"Enable multithreading support"
ON
)
list
(
APPEND CMAKE_MODULE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake
)
...
...
@@ -51,7 +52,9 @@ if (WITH_GFLAGS)
endif
(
gflags_FOUND
)
endif
(
WITH_GFLAGS
)
find_package
(
Threads
)
if
(
WITH_THREADS
)
find_package
(
Threads
)
endif
(
WITH_THREADS
)
check_include_file
(
dlfcn.h HAVE_DLFCN_H
)
check_include_file
(
execinfo.h HAVE_EXECINFO_H
)
...
...
@@ -306,9 +309,13 @@ endif (HAVE_USING_OPERATOR)
set
(
SIZEOF_VOID_P
${
CMAKE_SIZEOF_VOID_P
}
)
if
(
Threads_FOUND AND CMAKE_USE_PTHREADS_INIT
)
if
(
WITH_THREADS AND Threads_FOUND
)
if
(
CMAKE_USE_PTHREADS_INIT
)
set
(
HAVE_PTHREAD 1
)
endif
(
Threads_FOUND AND CMAKE_USE_PTHREADS_INIT
)
endif
(
CMAKE_USE_PTHREADS_INIT
)
else
(
WITH_THREADS AND Threads_FOUND
)
set
(
NO_THREADS 1
)
endif
(
WITH_THREADS AND Threads_FOUND
)
set
(
TEST_SRC_DIR \
"
${
CMAKE_CURRENT_SOURCE_DIR
}
\"
)
...
...
@@ -428,12 +435,6 @@ else (NOT BUILD_SHARED_LIBS)
"GOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS=
${
_IMPORT
}
"
)
endif
(
NOT BUILD_SHARED_LIBS
)
if
(
HAVE_PTHREAD
)
target_link_libraries
(
glog PUBLIC
${
CMAKE_THREAD_LIBS_INIT
}
)
else
(
HAVE_PTHREAD
)
target_compile_definitions
(
glog PUBLIC NO_THREADS
)
endif
(
HAVE_PTHREAD
)
if
(
HAVE_EXECINFO_H
)
set
(
HAVE_STACKTRACE 1
)
endif
(
HAVE_EXECINFO_H
)
...
...
src/config.h.cmake.in
View file @
85e5c6ed
...
...
@@ -46,6 +46,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H
/* define to disable multithreading support. */
#cmakedefine NO_THREADS
/* define if the compiler implements namespaces */
#cmakedefine HAVE_NAMESPACES
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment