diff options
author | paul4334 <paul.sultana@pc-doctor.com> | 2019-04-30 16:35:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-30 16:35:04 -0700 |
commit | a7265dd139fbe5162b62777401293ea7b8cac79a (patch) | |
tree | 7d8ce51f4966179a8079dfa8eaeb575a0fd0cc97 | |
parent | 38c884f205111aaa65c0940a4c805f19821dac02 (diff) | |
download | portable-a7265dd139fbe5162b62777401293ea7b8cac79a.tar.gz portable-a7265dd139fbe5162b62777401293ea7b8cac79a.tar.bz2 portable-a7265dd139fbe5162b62777401293ea7b8cac79a.zip |
Fix MacOSX cmake missing symbol _clock_gettime
On El Capitan:
[exec] [100%] Linking C executable openssl
[exec] Undefined symbols for architecture x86_64:
[exec] "_clock_gettime", referenced from:
[exec] _app_timer_real in apps_posix.c.o
[exec] ld: symbol(s) not found for architecture x86_64
[exec] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[exec] make[2]: *** [apps/openssl/openssl] Error 1
[exec] make[1]: *** [apps/openssl/CMakeFiles/openssl.dir/all] Error 2
[exec] make: *** [all] Error 2
-rw-r--r-- | apps/openssl/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/openssl/CMakeLists.txt b/apps/openssl/CMakeLists.txt index db63ecf..6d89c06 100644 --- a/apps/openssl/CMakeLists.txt +++ b/apps/openssl/CMakeLists.txt | |||
@@ -67,6 +67,13 @@ else() | |||
67 | set(OPENSSL_SRC ${OPENSSL_SRC} compat/strtonum.c) | 67 | set(OPENSSL_SRC ${OPENSSL_SRC} compat/strtonum.c) |
68 | endif() | 68 | endif() |
69 | 69 | ||
70 | if(CMAKE_SYSTEM_NAME MATCHES "Darwin") | ||
71 | check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) | ||
72 | if(NOT HAVE_CLOCK_GETTIME) | ||
73 | set(OPENSSL_SRC ${OPENSSL_SRC} compat/clock_gettime_osx.c) | ||
74 | endif() | ||
75 | endif() | ||
76 | |||
70 | add_executable(openssl ${OPENSSL_SRC}) | 77 | add_executable(openssl ${OPENSSL_SRC}) |
71 | target_include_directories(openssl PRIVATE . ../../include/compat) | 78 | target_include_directories(openssl PRIVATE . ../../include/compat) |
72 | target_link_libraries(openssl ${OPENSSL_LIBS}) | 79 | target_link_libraries(openssl ${OPENSSL_LIBS}) |