mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-11 06:15:05 +00:00
cmake: Replace modified RelWithDebInfo with Speed
This commit is contained in:
parent
569e39fe3b
commit
20d5eef32e
2 changed files with 57 additions and 31 deletions
36
.github/workflows/main.yml
vendored
36
.github/workflows/main.yml
vendored
|
@ -11,11 +11,11 @@ jobs:
|
||||||
- name: "Configure Project"
|
- name: "Configure Project"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cmake -H. -B"build/temp" -G"Visual Studio 16 2019" -A"x64" -T"host=x64" -DCMAKE_PACKAGE_NAME=StreamFX -DCMAKE_INSTALL_PREFIX="build/distrib" -DCMAKE_PACKAGE_PREFIX="build/package" -DOBS_DOWNLOAD=ON -DBUILD_SPEED=ON
|
cmake -H. -B"build/temp" -G"Visual Studio 16 2019" -A"x64" -T"host=x64" -DCMAKE_PACKAGE_NAME=StreamFX -DCMAKE_INSTALL_PREFIX="build/distrib" -DCMAKE_PACKAGE_PREFIX="build/package" -DOBS_DOWNLOAD=ON
|
||||||
- name: "Build Project"
|
- name: "Build Project"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cmake --build "build/temp" --config RelWithDebInfo
|
cmake --build "build/temp" --config RelWithDebInfo --target INSTALL
|
||||||
- name: "Package Project"
|
- name: "Package Project"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
@ -35,3 +35,35 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: windows
|
name: windows
|
||||||
path: build/package
|
path: build/package
|
||||||
|
windows-speed:
|
||||||
|
runs-on: windows-2019
|
||||||
|
steps:
|
||||||
|
- name: "Clone Repository"
|
||||||
|
uses: actions/checkout@v1
|
||||||
|
- name: "Configure Project"
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cmake -H. -B"build/temp" -G"Visual Studio 16 2019" -A"x64" -T"host=x64" -DCMAKE_PACKAGE_NAME=StreamFX -DCMAKE_INSTALL_PREFIX="build/distrib" -DCMAKE_PACKAGE_PREFIX="build/package" -DOBS_DOWNLOAD=ON
|
||||||
|
- name: "Build Project"
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cmake --build "build/temp" --config Speed --target INSTALL
|
||||||
|
- name: "Package Project"
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cmake --build "build/temp" --config Speed --target PACKAGE_7Z
|
||||||
|
cmake --build "build/temp" --config Speed --target PACKAGE_ZIP
|
||||||
|
- name: "Package Installer (Prereqs)"
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl "-kL" "https://cdn.xaymar.com/ci/innosetup-6.0.3.exe" "-f" "--retry" "5" "-o" "inno.exe"
|
||||||
|
.\inno.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
|
||||||
|
- name: "Package Installer (Compile)"
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\build\64\installer.iss"
|
||||||
|
- name: "Upload Artifacts"
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: windows
|
||||||
|
path: build/package
|
||||||
|
|
|
@ -102,7 +102,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
||||||
# using Intel C++
|
# using Intel C++
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
set(MSVC_EXTRA_FLAGS "/wd4061 /wd4100 /wd4180 /wd4201 /wd4464 /wd4514 /wd4571 /wd4623 /wd4625 /wd4626 /wd4710 /wd4774 /wd4820 /wd5026 /wd5027 /wd5045")
|
set(MSVC_EXTRA_FLAGS "/wd4061 /wd4100 /wd4180 /wd4201 /wd4464 /wd4505 /wd4514 /wd4571 /wd4623 /wd4625 /wd4626 /wd4710 /wd4774 /wd4820 /wd5026 /wd5027 /wd5045")
|
||||||
# Force to always compile with W4
|
# Force to always compile with W4
|
||||||
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
||||||
string(REGEX REPLACE "/W[0-4]" "/Wall" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REGEX REPLACE "/W[0-4]" "/Wall" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
@ -117,6 +117,28 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall")
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MSVC_EXTRA_FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MSVC_EXTRA_FLAGS}")
|
||||||
|
|
||||||
|
# Speed Optimized Configuration
|
||||||
|
set(_SPEED_COMPILER_FLAGS "/O2 /Oi /Ot /Oy /GF /GS- /Qpar /arch:AVX /GR /GL")
|
||||||
|
set(_SPEED_LINKER_FLAGS "/LTCG:incremental /OPT:ICF=4 /INCREMENTAL /OPT:REF")
|
||||||
|
set(CMAKE_CXX_FLAGS_SPEED "${CMAKE_CXX_FLAGS_RELWTIHDEBINFO} ${_SPEED_COMPILER_FLAGS}")
|
||||||
|
set(CMAKE_C_FLAGS_SPEED "${CMAKE_C_FLAGS_RELWTIHDEBINFO} ${_SPEED_COMPILER_FLAGS}")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_SPEED "${CMAKE_EXE_LINKER_FLAGS_RELWTIHDEBINFO} ${_SPEED_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_SPEED "${CMAKE_EXE_LINKER_FLAGS_RELWTIHDEBINFO} ${_SPEED_LINKER_FLAGS}")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS_SPEED "${CMAKE_EXE_LINKER_FLAGS_RELWTIHDEBINFO} ${_SPEED_LINKER_FLAGS}")
|
||||||
|
mark_as_advanced(
|
||||||
|
CMAKE_CXX_FLAGS_SPEED
|
||||||
|
CMAKE_C_FLAGS_SPEED
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_SPEED
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_SPEED
|
||||||
|
CMAKE_MODULE_LINKER_FLAGS_SPEED
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CMAKE_CONFIGURATION_TYPES)
|
||||||
|
list(APPEND CMAKE_CONFIGURATION_TYPES Speed)
|
||||||
|
list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES)
|
||||||
|
CacheSet(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# C++ Standard and Extensions
|
# C++ Standard and Extensions
|
||||||
|
@ -166,34 +188,6 @@ else()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(${PropertyPrefix}BUILD_SIZE FALSE CACHE BOOL "Focus on small size instead of maximum performance in release builds.")
|
|
||||||
set(${PropertyPrefix}BUILD_SPEED TRUE CACHE BOOL "Focus on maximum performance instead of small size in release builds.")
|
|
||||||
if(${PropertyPrefix}BUILD_SIZE)
|
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
||||||
set(_EXTRA_FLAGS "/O1 /Os /GF /GS- /arch:AVX /GR /GL /LTCG:incremental /OPT:ICF")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${_EXTRA_FLAGS}")
|
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${_EXTRA_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${_EXTRA_FLAGS}")
|
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${_EXTRA_FLAGS}")
|
|
||||||
unset(_EXTRA_FLAGS)
|
|
||||||
endif()
|
|
||||||
elseif(${PropertyPrefix}BUILD_SPEED)
|
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
||||||
set(_EXTRA_FLAGS "/O2 /Oi /Ot /Oy /GF /GS- /Qpar /arch:AVX /GR /GL /LTCG:incremental /OPT:ICF")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${_EXTRA_FLAGS}")
|
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${_EXTRA_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${_EXTRA_FLAGS}")
|
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${_EXTRA_FLAGS}")
|
|
||||||
unset(_EXTRA_FLAGS)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# CMake / Compiler Dependencies
|
# CMake / Compiler Dependencies
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
Loading…
Reference in a new issue