Skip to content

Commit

Permalink
Add options to CMakeLists.txt for optimizing build
Browse files Browse the repository at this point in the history
  • Loading branch information
gottcode committed Jun 19, 2022
1 parent 95c6254 commit f4107bd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,24 @@ elseif(WIN32)
)
endif()

# Optimize build
option(ENABLE_LINK_TIME_OPTIMIZATION "Enable link time optimization" OFF)
if(ENABLE_LINK_TIME_OPTIMIZATION)
include(CheckIPOSupported)
check_ipo_supported(RESULT result)
if(result)
set_target_properties(focuswriter PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()

option(ENABLE_STRIP "Enable automatic stripping of release builds" OFF)
if(ENABLE_STRIP)
add_custom_command(TARGET focuswriter
POST_BUILD
COMMAND ${CMAKE_STRIP} $<TARGET_FILE:focuswriter>
)
endif()

# Create symbols
add_subdirectory(resources/symbols)

Expand Down

0 comments on commit f4107bd

Please sign in to comment.