1
0
Fork 0
mirror of https://gitlab.com/niansa/SomeBot.git synced 2025-03-06 20:48:26 +01:00

Minor adjustments

This commit is contained in:
niansa 2022-12-27 18:56:33 +01:00
parent 4e5fe4a4c7
commit eadb255dd0

View file

@ -16,15 +16,21 @@ file(GLOB MODULES modules/*.cpp modules/*.hpp)
add_executable(KeineAhnung main.cpp util.cpp ${MODULES})
target_link_libraries(KeineAhnung PRIVATE dpp justgpt sqlite3 pthread)
set_property(TARGET KeineAhnung PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set_property(TARGET KeineAhnung PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
message(STATUS "Interprocedural optimization is enabled")
endif()
target_compile_options(KeineAhnung PRIVATE
-Wall -Wextra -Wpedantic
)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(UBSAN_FLAGS "-fsanitize=undefined" "-fsanitize-minimal-runtime")
set(UBSAN_FLAGS "-fsanitize=undefined")
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(UBSAN_FLAGS ${UBSAN_FLAGS} "-fsanitize-minimal-runtime")
endif()
target_compile_options(KeineAhnung PUBLIC ${UBSAN_FLAGS})
target_link_options(KeineAhnung PUBLIC ${UBSAN_FLAGS})
message(STATUS "Minimal undefined sanitizer runtime is enabled")
message(STATUS "Undefined sanitizer runtime is enabled")
endif()
install(TARGETS KeineAhnung