mirror of
https://github.com/simon987/sist2.git
synced 2025-04-16 17:06:41 +00:00
Update libmagic cmake things
This commit is contained in:
parent
779303a2f7
commit
036ed9ea1e
@ -4,6 +4,7 @@ set(CMAKE_C_STANDARD 11)
|
||||
project(sist2 C)
|
||||
|
||||
option(SIST_DEBUG "Build a debug executable" on)
|
||||
option(SIST_FAST "Enable more optimisation flags" off)
|
||||
option(SIST_FAKE_STORE "Disable IO operations of LMDB stores for debugging purposes" 0)
|
||||
|
||||
add_compile_definitions(
|
||||
@ -54,6 +55,10 @@ find_package(lmdb CONFIG REQUIRED)
|
||||
find_package(cJSON CONFIG REQUIRED)
|
||||
find_package(unofficial-mongoose CONFIG REQUIRED)
|
||||
find_package(CURL CONFIG REQUIRED)
|
||||
find_library(MAGIC_LIB
|
||||
NAMES libmagic.so.1 magic
|
||||
PATHS /usr/lib/x86_64-linux-gnu/ /usr/lib/aarch64-linux-gnu/
|
||||
)
|
||||
|
||||
|
||||
target_include_directories(
|
||||
@ -93,16 +98,25 @@ if (SIST_DEBUG)
|
||||
PROPERTIES
|
||||
OUTPUT_NAME sist2_debug
|
||||
)
|
||||
elseif (SIST_FAST)
|
||||
target_compile_options(
|
||||
sist2
|
||||
PRIVATE
|
||||
|
||||
-Ofast
|
||||
-march=native
|
||||
-fno-stack-protector
|
||||
-fomit-frame-pointer
|
||||
-freciprocal-math
|
||||
)
|
||||
else ()
|
||||
target_compile_options(
|
||||
sist2
|
||||
PRIVATE
|
||||
|
||||
-Ofast
|
||||
#-march=native
|
||||
-fno-stack-protector
|
||||
-fomit-frame-pointer
|
||||
#-freciprocal-math
|
||||
)
|
||||
endif ()
|
||||
|
||||
@ -124,13 +138,12 @@ target_link_libraries(
|
||||
CURL::libcurl
|
||||
|
||||
pthread
|
||||
#magic
|
||||
|
||||
c
|
||||
|
||||
scan
|
||||
|
||||
/usr/lib/x86_64-linux-gnu/libmagic.so.1
|
||||
${MAGIC_LIB}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
|
16
third-party/libscan/CMakeLists.txt
vendored
16
third-party/libscan/CMakeLists.txt
vendored
@ -42,6 +42,22 @@ if (SIST_DEBUG)
|
||||
-fsanitize=address
|
||||
-fno-inline
|
||||
)
|
||||
elseif (SIST_FAST)
|
||||
add_compile_definitions(
|
||||
antiword
|
||||
NDEBUG
|
||||
)
|
||||
|
||||
target_compile_options(
|
||||
scan
|
||||
PRIVATE
|
||||
|
||||
-Ofast
|
||||
-march=native
|
||||
-fno-stack-protector
|
||||
-fomit-frame-pointer
|
||||
-freciprocal-math
|
||||
)
|
||||
else()
|
||||
add_compile_definitions(
|
||||
antiword
|
||||
|
Loading…
x
Reference in New Issue
Block a user