build: Disable restrict warning

This commit is contained in:
WerWolv 2022-08-05 08:32:08 +02:00
parent 12547a7c8c
commit 5a41be48c3
6 changed files with 10 additions and 6 deletions

View File

@ -366,4 +366,8 @@ function(downloadImHexPatternsFiles dest)
endforeach ()
endif ()
endfunction()
endfunction()
macro(setupCompilerWarnings target)
target_compile_options(${target} PRIVATE -Wall -Wextra -Werror -Wno-restrict)
endmacro()

View File

@ -155,7 +155,7 @@ add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}")
add_library(libimhex SHARED ${LIBIMHEX_SOURCES})
set_target_properties(libimhex PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_options(libimhex PRIVATE -Wall -Wextra -Werror)
setupCompilerWarnings(libimhex)
target_include_directories(libimhex PUBLIC include ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${Python_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${YARA_INCLUDE_DIRS})
target_link_directories(libimhex PUBLIC ${MBEDTLS_LIBRARY_DIR} ${CAPSTONE_LIBRARY_DIRS} ${MAGIC_LIBRARY_DIRS})

View File

@ -15,7 +15,7 @@ add_executable(main ${APPLICATION_TYPE}
)
target_include_directories(main PUBLIC include)
target_compile_options(main PRIVATE -Wall -Wextra -Werror)
setupCompilerWarnings(main)
set_target_properties(main PROPERTIES
OUTPUT_NAME "imhex"

View File

@ -81,4 +81,4 @@ endif()
add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}")
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
setupCompilerWarnings(${PROJECT_NAME})

View File

@ -27,4 +27,4 @@ endif()
add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}")
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
setupCompilerWarnings(${PROJECT_NAME})

View File

@ -39,6 +39,6 @@ if (WIN32)
add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}")
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
setupCompilerWarnings(${PROJECT_NAME})
endif ()