1
0
forked from um/kgg-dec
kgg-dec/CMakeLists.txt

39 lines
1.1 KiB
CMake
Raw Normal View History

2024-10-17 00:50:14 +00:00
cmake_minimum_required(VERSION 3.10)
project(kgg-dec LANGUAGES CXX)
include(CheckIPOSupported)
check_ipo_supported(RESULT lto_supported OUTPUT error)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(kgg-dec
2024-10-17 23:11:16 +00:00
src/main.cpp
src/common/base64.cpp
src/infra/infra.cpp
src/tc_tea/tc_tea.cpp
src/qmc2/ekey.cpp
src/qmc2/qmc2_factory.cpp
src/qmc2/qmc2_map.cpp
src/qmc2/qmc2_rc4.cpp
2024-10-17 00:50:14 +00:00
)
target_include_directories(kgg-dec
2024-10-17 23:11:16 +00:00
PRIVATE
2024-10-17 00:50:14 +00:00
src/common
src/tc_tea
)
target_link_libraries(kgg-dec PRIVATE shell32 ole32)
2024-10-17 23:11:16 +00:00
target_compile_definitions(kgg-dec PRIVATE NOMINMAX)
2024-10-17 00:50:14 +00:00
if (lto_supported)
set_property(TARGET kgg-dec PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
2024-10-17 23:11:16 +00:00
endif ()
2024-10-17 00:50:14 +00:00
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s -fdata-sections -ffunction-sections -flto -fmerge-all-constants -fno-exceptions -fno-rtti")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s -Wl,--gc-sections -flto")
2024-10-17 23:11:16 +00:00
endif ()