File tree Expand file tree Collapse file tree 4 files changed +20
-239
lines changed Expand file tree Collapse file tree 4 files changed +20
-239
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,16 @@ find_package(LibXslt REQUIRED)
143
143
find_package (BZip2 )
144
144
145
145
# PThread
146
+ if (WIN32 )
147
+ find_package (ZLIB REQUIRED )
148
+ find_package (pthread CONFIG REQUIRED )
149
+ set (CMAKE_THREAD_LIBS_INIT ${PThreads4W_LIBRARY} )
150
+ else ()
151
+ find_package (Threads REQUIRED )
152
+ endif ()
146
153
set (CMAKE_THREAD_PREFER_PTHREAD )
147
154
set (THREADS_PREFER_PTHREAD_FLAG )
148
- set (THREADS_USE_PTHREADS_WIN32 true )
149
- find_package (Threads REQUIRED )
155
+ set (THREADS_USE_PTHREADS_WIN32 TRUE )
150
156
check_library_exists (pthread pthread_timedjoin_np "" HAVE_PTHREAD_TIMEDJOIN_NP )
151
157
check_library_exists (pthread pthread_setname_np "" HAVE_PTHREAD_SETNAME_NP )
152
158
check_library_exists (pthread pthread_getname_np "" HAVE_PTHREAD_GETNAME_NP )
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ image: Visual Studio 2017
7
7
configuration : Release
8
8
clone_folder : c:\projects\openscap
9
9
install :
10
- - cmd : vcpkg install curl libxml2 libxslt bzip2 pcre pthreads
10
+ - cmd : vcpkg install curl libxml2 libxslt bzip2 pcre pthreads zlib getopt-win32
11
11
cache : c:\tools\vcpkg\installed\
12
12
before_build :
13
13
- cmd : >-
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,6 +10,17 @@ if(ENABLE_OSCAP_UTIL)
10
10
add_executable (oscap ${UTILS_SOURCES} )
11
11
target_link_libraries (oscap openscap )
12
12
if (WIN32 )
13
+ find_path (GETOPT_INCLUDE_DIR getopt.h )
14
+ include (SelectLibraryConfigurations )
15
+ find_library (GETOPT_LIBRARY_RELEASE NAMES getopt )
16
+ find_library (GETOPT_LIBRARY_DEBUG NAMES getopt PATH_SUFFIXES debug/lib )
17
+ select_library_configurations (GETOPT )
18
+
19
+ message ("GETOPT_INCLUDE_DIR: ${GETOPT_INCLUDE_DIR} " )
20
+ message ("GETOPT_LIBRARY: ${GETOPT_LIBRARY} " )
21
+
22
+ target_include_directories (oscap PRIVATE ${GETOPT_INCLUDE_DIR} )
23
+ target_link_libraries (oscap PRIVATE ${GETOPT_LIBRARY} )
13
24
set (OSCAP_UTIL_DESTINATION "." )
14
25
# Install the 'oscap' utility
15
26
install (TARGETS "oscap"
You can’t perform that action at this time.
0 commit comments