[cmake] refactor configuration

* Split common stuff to reusable files
* Disable INTERPROCEDURAL_OPTIMIZATION for SDL2/3 resource targets
This commit is contained in:
akallabeth
2024-11-12 09:36:25 +01:00
parent 2bb75c195b
commit 0ae7c4b52d
19 changed files with 181 additions and 277 deletions

View File

@@ -32,15 +32,9 @@ if(NOT FREERDP_UNIFIED_BUILD)
set(CMAKE_C_EXTENSIONS ON)
set(WINPR_VERSION_MAJOR 3)
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
option(BUILD_TESTING_INTERNAL "Build library unit tests" ON)
if(CMAKE_COMPILER_IS_GNUCC)
if(NOT EXPORT_ALL_SYMBOLS)
message(STATUS "GCC default symbol visibility: hidden")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
endif()
endif()
include(ExportAllSymbols)
else()
set(WINPR_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
endif()
@@ -62,7 +56,7 @@ include(CheckCCompilerFlag)
include(CMakePackageConfigHelpers)
include(SetFreeRDPCMakeInstallDir)
option(RDTK_FORCE_STATIC_BUILD "Force RDTK to be built as static library (recommended)" OFF)
option(RDTK_FORCE_STATIC_BUILD "Force RDTK to be build as static library (recommended)" OFF)
if(RDTK_FORCE_STATIC_BUILD)
set(BUILD_SHARED_LIBS OFF)
endif()