Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
G
gflags
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
gflags
Commits
c5627a75
Commit
c5627a75
authored
Mar 17, 2014
by
Andreas Schuh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CheckForPthreads.cxx to find pthreads library on Ubuntu.
parent
6e4c22e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
CMakeLists.txt
CMakeLists.txt
+1
-1
CheckForPthreads.cxx
cmake/CheckForPthreads.cxx
+38
-0
FindThreadsCxx.cmake
cmake/FindThreadsCxx.cmake
+1
-1
No files found.
CMakeLists.txt
View file @
c5627a75
...
...
@@ -15,7 +15,7 @@ set (PACKAGE_STRING "${PROJECT_NAME} ${PACKAGE_VERSION}")
set
(
PACKAGE_TARNAME
"
${
PROJECT_NAME
}
-
${
PACKAGE_VERSION
}
"
)
set
(
PACKAGE_BUGREPORT
"https://code.google.com/p/gflags/issues/"
)
project
(
${
PROJECT_NAME
}
CXX
C
)
project
(
${
PROJECT_NAME
}
CXX
)
version_numbers
(
${
PACKAGE_VERSION
}
...
...
cmake/CheckForPthreads.cxx
0 → 100644
View file @
c5627a75
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
void
*
runner
(
void
*
);
int
res
=
0
;
#ifdef __CLASSIC_C__
int
main
(){
int
ac
;
char
*
av
[];
#else
int
main
(
int
ac
,
char
*
av
[]){
#endif
pthread_t
tid
[
2
];
pthread_create
(
&
tid
[
0
],
0
,
runner
,
(
void
*
)
1
);
pthread_create
(
&
tid
[
1
],
0
,
runner
,
(
void
*
)
2
);
#if defined(__BEOS__) && !defined(__ZETA__) // (no usleep on BeOS 5.)
usleep
(
1
);
// for strange behavior on single-processor sun
#endif
pthread_join
(
tid
[
0
],
0
);
pthread_join
(
tid
[
1
],
0
);
if
(
ac
>
1000
){
return
*
av
[
0
];}
return
res
;
}
void
*
runner
(
void
*
args
)
{
int
cc
;
for
(
cc
=
0
;
cc
<
10
;
cc
++
)
{
printf
(
"%d CC: %d
\n
"
,
(
int
)
args
,
cc
);
}
res
++
;
return
0
;
}
cmake/FindThreadsCxx.cmake
View file @
c5627a75
...
...
@@ -100,7 +100,7 @@ else()
message
(
STATUS
"Check if compiler accepts -pthread"
)
try_run
(
THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
${
CMAKE_BINARY_DIR
}
${
CMAKE_ROOT
}
/Modules/CheckForPthreads.c
${
CMAKE_ROOT
}
/Modules/CheckForPthreads.c
xx
CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
COMPILE_OUTPUT_VARIABLE OUTPUT
)
...
...
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