From 25154dd45040ec542b6a7904a58d056956406765 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 18 Jun 2023 14:42:48 +0200 Subject: [PATCH] build: Force enable exceptions and rtti --- cmake/build_helpers.cmake | 5 +++-- lib/external/pattern_language | 2 +- lib/libimhex/CMakeLists.txt | 2 +- main/CMakeLists.txt | 2 +- plugins/builtin/CMakeLists.txt | 2 +- plugins/windows/CMakeLists.txt | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmake/build_helpers.cmake b/cmake/build_helpers.cmake index 01eeea1ae..0b7608727 100644 --- a/cmake/build_helpers.cmake +++ b/cmake/build_helpers.cmake @@ -411,17 +411,18 @@ function(downloadImHexPatternsFiles dest) endfunction() -macro(setupCompilerWarnings target) +macro(setupCompilerFlags target) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") set(IMHEX_COMMON_FLAGS "-Wall -Wextra -Wpedantic -Werror") set(IMHEX_C_FLAGS "${IMHEX_COMMON_FLAGS} -Wno-array-bounds") + set(IMHEX_CXX_FLAGS "-fexceptions -frtti") if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") set(IMHEX_C_FLAGS "${IMHEX_C_FLAGS} -Wno-restrict -Wno-stringop-overread -Wno-stringop-overflow -Wno-dangling-reference") endif() endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IMHEX_C_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_C_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_CXX_FLAGS} ${IMHEX_C_FLAGS}") set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${IMHEX_COMMON_FLAGS}") endmacro() diff --git a/lib/external/pattern_language b/lib/external/pattern_language index 1118a8bd3..715037612 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit 1118a8bd377a9e8bd853419fea2dc04fa9912b22 +Subproject commit 7150376123c8a357e183b030b8102f90e1a2bf9c diff --git a/lib/libimhex/CMakeLists.txt b/lib/libimhex/CMakeLists.txt index e7c679b1e..6ae15bdba 100644 --- a/lib/libimhex/CMakeLists.txt +++ b/lib/libimhex/CMakeLists.txt @@ -56,7 +56,7 @@ add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}") add_library(libimhex SHARED ${LIBIMHEX_SOURCES}) set_target_properties(libimhex PROPERTIES POSITION_INDEPENDENT_CODE ON) -setupCompilerWarnings(libimhex) +setupCompilerFlags(libimhex) target_include_directories(libimhex PUBLIC include ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIRS} ${CAPSTONE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} ${YARA_INCLUDE_DIRS} ${LIBBACKTRACE_INCLUDE_DIRS}) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 56b82279d..8f0f0627a 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -16,7 +16,7 @@ add_executable(main ${APPLICATION_TYPE} ) target_include_directories(main PUBLIC include) -setupCompilerWarnings(main) +setupCompilerFlags(main) set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs) set(LIBROMFS_PROJECT_NAME imhex) diff --git a/plugins/builtin/CMakeLists.txt b/plugins/builtin/CMakeLists.txt index eac25e523..425da2dd3 100644 --- a/plugins/builtin/CMakeLists.txt +++ b/plugins/builtin/CMakeLists.txt @@ -83,7 +83,7 @@ endif() add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}") set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) -setupCompilerWarnings(${PROJECT_NAME}) +setupCompilerFlags(${PROJECT_NAME}) set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs) set(LIBROMFS_PROJECT_NAME ${PROJECT_NAME}) diff --git a/plugins/windows/CMakeLists.txt b/plugins/windows/CMakeLists.txt index 37e06fff4..4421e731b 100644 --- a/plugins/windows/CMakeLists.txt +++ b/plugins/windows/CMakeLists.txt @@ -36,7 +36,7 @@ if (WIN32) add_compile_definitions(IMHEX_PROJECT_NAME="${PROJECT_NAME}") set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON) - setupCompilerWarnings(${PROJECT_NAME}) + setupCompilerFlags(${PROJECT_NAME}) set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs) set(LIBROMFS_PROJECT_NAME ${PROJECT_NAME})