Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix HighDPI support, remove cxxbasics, improve LTO + PIE detection #418

Open
wants to merge 1 commit into
base: native
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: cpp
compiler: clang
sudo: require
dist: trusty
dist: xenial
before_install:
- sudo add-apt-repository ppa:beineri/opt-qt591-trusty -y
- sudo add-apt-repository ppa:beineri/opt-qt-5.15.0-xenial -y
- sudo apt-get update -qq
install:
- sudo apt-get -y -qq install cmake
- sudo apt-get -y -qq install libgl1-mesa-dev qt59base qt59imageformats qt59svg qt59charts-no-lgpl qt59tools
- sudo apt-get -y -qq install libgl1-mesa-dev qt515base qt515imageformats qt515svg qt515charts-no-lgpl qt515tools
- source /opt/qt*/bin/qt*-env.sh
before_script:
- mkdir build && cd build
Expand Down
32 changes: 30 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Stacer)

# Adding features(build cache + faster linkers) and reasonable defaults(Debug build by default)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxxbasics/CXXBasics.cmake")
# Build with PIC and PIE(default: ON)
option(CMAKE_POSITION_INDEPENDENT_CODE "Determines whether position independent executables or shared libraries will be created" ON)

# Build with LTO(default: OFF)
option(CMAKE_INTERPROCEDURAL_OPTIMIZATION "If set to true, enables interprocedural optimizations if they are known to be supported by the compiler" OFF)

if("${CMAKE_BUILD_TYPE}" STREQUAL "Release" OR "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
endif()

# Apply PIE flags if cmake_minimum_required is over 3.14(see policy CMP0083)
if(POLICY CMP0083)
cmake_policy(SET CMP0083 NEW)
include(CheckPIESupported)
check_pie_supported()
set(CMAKE_POLICY_DEFAULT_CMP0083 NEW)
endif(POLICY CMP0083)

# Build with LTO, if explicitly enabled
if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
if(POLICY CMP0069)
cmake_policy(SET CMP0069 NEW)
include(CheckIPOSupported)
check_ipo_supported()

set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_CXX_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_CXX_FLAGS}")
endif(POLICY CMP0069)
endif(CMAKE_INTERPROCEDURAL_OPTIMIZATION)

# Setting a cleaner directory structure for the generated binaries
set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/output")
Expand Down
20 changes: 0 additions & 20 deletions cmake/cxxbasics/CXXBasics.cmake

This file was deleted.

9 changes: 0 additions & 9 deletions cmake/cxxbasics/DefaultSettings.cmake

This file was deleted.

13 changes: 0 additions & 13 deletions cmake/cxxbasics/InitCXXBasics.cmake

This file was deleted.

24 changes: 0 additions & 24 deletions cmake/cxxbasics/UNLICENSE

This file was deleted.

15 changes: 0 additions & 15 deletions cmake/cxxbasics/accelerators/UseCCache.cmake

This file was deleted.

26 changes: 0 additions & 26 deletions cmake/cxxbasics/accelerators/UseCompilerCacheTool.cmake

This file was deleted.

105 changes: 0 additions & 105 deletions cmake/cxxbasics/accelerators/UseFasterLinkers.cmake

This file was deleted.

16 changes: 0 additions & 16 deletions cmake/cxxbasics/accelerators/UseSCCache.cmake

This file was deleted.

Loading