hydroforth/CMakeLists.txt

19 lines
522 B
CMake

cmake_minimum_required(VERSION 3.22.1)
project(hydroforth)
include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error)
file(GLOB_RECURSE SOURCES ${PROJECT_SOURCE_DIR}/src/*.c)
add_executable(hydroforth ${SOURCES})
if( supported )
message(STATUS "IPO / LTO enabled")
set_property(TARGET hydroforth PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "IPO / LTO not supported: <${error}>")
endif()
target_include_directories(hydroforth PRIVATE ${PROJECT_SOURCE_DIR}/include)