mirror of
https://gitlab.com/niansa/SomeBot.git
synced 2025-03-06 20:48:26 +01:00
41 lines
1.4 KiB
CMake
41 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.9)
|
|
|
|
project(KeineAhnung LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
add_subdirectory(DPP)
|
|
set(LUAU_BUILD_TESTS No)
|
|
add_subdirectory(luau)
|
|
set(LUABRIDGE_TESTING No)
|
|
set(LUABRIDGE_COVERAGE No)
|
|
add_subdirectory(LuaBridge3)
|
|
|
|
add_compile_definitions(COMPILER_ID="${CMAKE_CXX_COMPILER_ID}")
|
|
add_compile_definitions(COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}")
|
|
add_compile_definitions(COMPILER_PLATFORM="${CMAKE_CXX_PLATFORM_ID}")
|
|
|
|
file(GLOB MODULES modules/*.cpp modules/*.hpp)
|
|
|
|
add_executable(KeineAhnung main.cpp util.cpp ${MODULES})
|
|
target_link_libraries(KeineAhnung PRIVATE dpp sqlite3 pthread Luau.VM Luau.Compiler LuaBridge)
|
|
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")
|
|
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 "Undefined sanitizer runtime is enabled")
|
|
endif()
|
|
|
|
install(TARGETS KeineAhnung
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|