repo.or.cz
/
openttd-jgr.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Tracerestrict: Adjust comment for GetTraceRestrictTypeProperties
[openttd-jgr.git]
/
cmake
/
FindUcontext.cmake
blob
67118be9b75fb1974e969e70e06bd899a307773d
1
include(CheckCXXSourceCompiles)
2
3
check_cxx_source_compiles("
4
#include <ucontext.h>
5
int main() {
6
ucontext_t context;
7
#if defined(__x86_64__)
8
void *ptr = (void *) context.uc_mcontext.gregs[REG_RIP];
9
#elif defined(__i386)
10
void *ptr = (void *) context.uc_mcontext.gregs[REG_EIP];
11
#else
12
#error Unknown arch
13
#endif
14
return 0;
15
}"
16
UCONTEXT_FOUND
17
)
18
19
if (UCONTEXT_FOUND)
20
add_compile_options(
21
-DWITH_UCONTEXT
22
)
23
endif (UCONTEXT_FOUND)