File tree 4 files changed +24
-13
lines changed
4 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 1
1
if (TARGET itslib)
2
2
return ()
3
3
endif ()
4
- find_path (ITSLIB_PATH NAMES include /itslib/stringutils.h PATHS symlinks/itslib)
4
+ find_path (ITSLIB_PATH NAMES include /itslib/stringutils.h PATHS ${CMAKE_SOURCE_DIR} / symlinks/itslib)
5
5
if (ITSLIB_PATH STREQUAL "ITSLIB_PATH-NOTFOUND" )
6
6
include (FetchContent)
7
7
FetchContent_Populate(itslib
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ if (TARGET openssl_ssl)
3
3
endif ()
4
4
if (DARWIN)
5
5
find_path (OPENSSL_INCLUDE_PATH NAMES openssl/sha.h
6
- PATHS $ENV{OPENSSL_ROOT_DIR} /include /usr/include /usr/local/ include /usr/local/opt/openssl /include )
6
+ PATHS $ENV{OPENSSL_ROOT_DIR} /include /usr/local/opt/openssl/ include /usr/include /usr/local/include )
7
7
find_library (OPENSSL_CRYPTO_LIBRARY NAMES crypto
8
8
PATHS $ENV{OPENSSL_ROOT_DIR} /lib /usr/local/opt/openssl/lib /usr/lib /usr/local/lib)
9
9
find_library (OPENSSL_SSL_LIBRARY NAMES ssl
26
26
endif ()
27
27
28
28
find_path (OPENSSL_INCLUDE_PATH NAMES openssl/sha.h
29
- PATHS /usr/include /usr/local/ include /usr/local/opt/openssl /include )
29
+ PATHS /usr/local/opt/openssl/ include /usr/include /usr/local/include )
30
30
find_library (OPENSSL_CRYPTO_LIBRARY NAMES crypto
31
31
PATHS /usr/local/opt/openssl/lib /usr/lib /usr/local/lib)
32
32
find_library (OPENSSL_SSL_LIBRARY NAMES ssl
Original file line number Diff line number Diff line change 1
- include (FetchContent)
2
- FetchContent_Populate(zlib
3
- # TODO: we need a method of supplying a local cache of this file.
4
- URL https://www.zlib.net/zlib-1.3.tar.gz
5
- URL_HASH SHA256=ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e
6
- )
7
- set (ZLIBDIR ${CMAKE_BINARY_DIR} /zlib-src)
1
+ find_path (ZLIB_DIR NAMES inftrees.c PATHS ${CMAKE_SOURCE_DIR} /symlinks/zlib)
2
+ if (ZLIB_DIR STREQUAL "ZLIB_DIR-NOTFOUND" )
3
+ include (FetchContent)
4
+ FetchContent_Populate(zlib
5
+ # TODO: we need a method of supplying a local cache of this file.
6
+ URL https://www.zlib.net/zlib-1.3.tar.gz
7
+ URL_HASH SHA256=ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e
8
+ )
9
+ set (ZLIB_DIR ${CMAKE_BINARY_DIR} /zlib-src)
10
+ else ()
11
+ set (zlib_BINARY_DIR ${CMAKE_BINARY_DIR} /zlib-build )
12
+ endif ()
13
+
8
14
9
15
list (APPEND ZLIBFILES inftrees.c infback.c compress.c inffast.c adler32.c uncompr.c inflate.c deflate.c crc32.c trees.c zutil.c)
10
16
#list(APPEND ZLIBFILES gzclose.c gzread.c gzwrite.c gzlib.c) <-- build failure on macos because of missing include <unistd.h>
11
- list (TRANSFORM ZLIBFILES PREPEND ${ZLIBDIR } /)
17
+ list (TRANSFORM ZLIBFILES PREPEND ${ZLIB_DIR } /)
12
18
add_library (zlib ${LIBSTYLE} ${ZLIBFILES} )
13
- target_include_directories (zlib PUBLIC ${ZLIBDIR } )
19
+ target_include_directories (zlib PUBLIC ${ZLIB_DIR } )
14
20
21
+ include (FindPackageHandleStandardArgs)
22
+ find_package_handle_standard_args(zlib REQUIRED_VARS ZLIB_DIR)
15
23
Original file line number Diff line number Diff line change @@ -54,15 +54,18 @@ endif()
54
54
55
55
if (OPT_ANALYZE)
56
56
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
57
+ # see https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Static-Analyzer-Options.html#index-analyzer
57
58
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fanalyzer" )
58
59
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
60
+ # https://clang.llvm.org/docs/UsersManual.html
59
61
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --analyze" )
60
62
endif ()
61
63
endif ()
62
64
63
65
if (OPT_ASAN AND OPT_TSAN)
64
66
message (FATAL_ERROR "Only one sanitizer can be active at a time" )
65
67
elseif (OPT_ASAN)
68
+ # https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Instrumentation-Options.html#index-fsanitize_003daddress
66
69
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined" )
67
70
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address" )
68
71
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
@@ -160,7 +163,7 @@ if(MSVC)
160
163
# NOBITMAP - avoid error in mmreg.h
161
164
# NOMINMAX - remove 'max()' macro from global namespace
162
165
# NOGDI - ...
163
- add_definitions (-DNOMINMAX -DNOGDI -DNOBITMAP)
166
+ add_definitions (-DNOMINMAX -DNOGDI -DNOBITMAP -DWIN32_LEAN_AND_MEAN )
164
167
add_definitions (-DWIN32)
165
168
add_definitions (-D__STDC_WANT_SECURE_LIB__=1)
166
169
You can’t perform that action at this time.
0 commit comments