Windows porting: port hyperscan and chimera tools to windows.

This commit is contained in:
Lu, Qi
2018-05-08 12:05:44 -04:00
committed by Wang, Xiang W
parent bf87f8c003
commit 5a0885d235
34 changed files with 563 additions and 109 deletions

View File

@@ -10,9 +10,16 @@ if (BUILD_CHIMERA)
include_directories(${PCRE_INCLUDE_DIRS})
add_definitions(-DHS_HYBRID)
add_executable(hscheck ${hscheck_SOURCES})
target_link_libraries(hscheck hs chimera ${PCRE_LDFLAGS} expressionutil pthread)
if(NOT WIN32)
target_link_libraries(hscheck hs chimera ${PCRE_LDFLAGS} expressionutil pthread)
else()
target_link_libraries(hscheck hs chimera pcre expressionutil)
endif()
else()
add_executable(hscheck ${hscheck_SOURCES})
target_link_libraries(hscheck hs expressionutil pthread)
if(NOT WIN32)
target_link_libraries(hscheck hs expressionutil pthread)
else()
target_link_libraries(hscheck hs expressionutil)
endif()
endif()

View File

@@ -70,8 +70,11 @@
#include <stdexcept>
#include <string>
#include <thread>
#ifndef _WIN32
#include <getopt.h>
#else
#include "win_getopt.h"
#endif
#include <boost/algorithm/string/trim.hpp>
using namespace std;
@@ -625,7 +628,7 @@ void loadSignatureBuildSigs(const string &inFile,
}
}
int main(int argc, char **argv) {
int HS_CDECL main(int argc, char **argv) {
num_of_threads = max(1u, std::thread::hardware_concurrency());
#if !defined(RELEASE_BUILD)