Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
375gnu committed Nov 5, 2023
1 parent ccf6ef8 commit d25b087
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ jobs:
}
cmake -B '${{github.workspace}}/build' `
-G Ninja `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
-DVCPKG_TARGET_TRIPLET=${{matrix.platform}}-windows `
-DCMAKE_GENERATOR_PLATFORM="$GeneratorPlatform" `
Expand All @@ -86,6 +85,7 @@ jobs:
-DENABLE_QT6=ON `
-DENABLE_FFMPEG=ON `
-DENABLE_MINIAUDIO=ON `
-DENABLE_LTO=ON `
-DUSE_ICU=ON `
-DUSE_WIN_ICU=OFF
Expand Down
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ option(ENABLE_WIN "Build Windows native frontend? (Default: on)" ON)
option(ENABLE_FFMPEG "Support video capture using FFMPEG (Default: off)" OFF)
option(ENABLE_MINIAUDIO "Support audio playback using miniaudio (Default: off)" OFF)
option(ENABLE_TOOLS "Build different tools? (Default: off)" OFF)
option(FAST_MATH "Build with unsafe fast-math compiller option (Default: off)" OFF)
option(ENABLE_FAST_MATH "Build with unsafe fast-math compiller option (Default: off)" OFF)
option(ENABLE_TESTS "Enable unit tests? (Default: off)" OFF)
option(ENABLE_GLES "Build for OpenGL ES 2.0 instead of OpenGL 2.1 (Default: off)" OFF)
option(ENABLE_LTO "Enable link time optimizations (Default: off)" OFF)
option(USE_GTKGLEXT "Use libgtkglext1 for GTK2 frontend (Default: on)" ON)
option(USE_GTK3 "Use Gtk3 in GTK2 frontend (Default: off)" OFF)
option(USE_WAYLAND "Use Wayland in Qt frontend (Default: off)" OFF)
Expand Down Expand Up @@ -172,7 +173,7 @@ if(USE_WEFFCPP AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()
endif()

EnableFastMath(${FAST_MATH})
EnableFastMath(${ENABLE_FAST_MATH})

#
# NLS (Gettext) support
Expand Down Expand Up @@ -406,14 +407,20 @@ else()
)
endif()
endif()
if("${build_type_lc}" STREQUAL "release")
endif()

if(ENABLE_LTO)
if(WIN32)
message(WARNING "LTO is not supported yet when building for Windows")
set(ENABLE_LTO OFF)
else()
include(CheckIPOSupported)
check_ipo_supported(RESULT lto_supported)
if(lto_supported)
message(STATUS "LTO is supported")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
else()
message(STATUS "LTO is not supported")
message(WARNING "LTO is not supported")
set(ENABLE_LTO OFF)
endif()
endif()
endif()
Expand Down
6 changes: 5 additions & 1 deletion src/celestia/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@ if(ENABLE_FFMPEG)
target_link_libraries(celestia ${FFMPEG_LIBRARIES})
endif()

if (HAVE_MESHOPTIMIZER)
if(HAVE_MESHOPTIMIZER)
target_link_libraries(celestia meshoptimizer::meshoptimizer)
endif()

if(ENABLE_LTO)
set_target_properties(celestia PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON)
endif()

if(WIN32)
install(
TARGETS celestia
Expand Down
4 changes: 4 additions & 0 deletions src/celestia/qt5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ if(APPLE)
set_property(TARGET celestia-qt5 APPEND_STRING PROPERTY LINK_FLAGS " -framework CoreServices")
endif()

if(ENABLE_LTO)
set_target_properties(celestia-qt5 PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON)
endif()

install(
TARGETS celestia-qt5
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
Expand Down
4 changes: 4 additions & 0 deletions src/celestia/qt6/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ install(
COMPONENT qt6gui
)

if(ENABLE_LTO)
set_target_properties(celestia-qt6 PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON)
endif()

if(WIN32)
qt6_generate_deploy_app_script(TARGET celestia-qt6
OUTPUT_SCRIPT deploy-celestia-qt6
Expand Down

0 comments on commit d25b087

Please sign in to comment.