Skip to content

Commit

Permalink
Use cmake_dependent_option to better declare variables that relate on…
Browse files Browse the repository at this point in the history
… other variables
  • Loading branch information
ilya-fedin authored and john-preston committed Aug 11, 2022
1 parent 10d5f4b commit a5fbc91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0076 NEW)
cmake_policy(SET CMP0091 NEW)
include(CMakeDependentOption)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

set(TG_OWT_SPECIAL_TARGET "" CACHE STRING "Use special platform target, like 'macstore' for Mac App Store.")

set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11 CACHE STRING "Minimum OS X deployment version" FORCE)

if (NOT TG_OWT_SPECIAL_TARGET STREQUAL "")
get_filename_component(parent_dir .. REALPATH)
get_filename_component(parent_dir ${parent_dir} NAME)
if (parent_dir STREQUAL "Libraries")
set(TG_OWT_PACKAGED_BUILD 0)
else()
set(TG_OWT_PACKAGED_BUILD 1)
Expand All @@ -21,14 +24,10 @@ endif()

option(BUILD_SHARED_LIBS "Builds shared libraries instead of static." OFF)
option(TG_OWT_USE_PROTOBUF "Use protobuf to generate additional headers. Useful for packaged build." ${BUILD_SHARED_LIBS})
option(TG_OWT_USE_PIPEWIRE "Use pipewire for desktop capture on non-Apple Unix." ON)
option(TG_OWT_DLOPEN_PIPEWIRE "dlopen pipewire 0.3 for desktop capture on non-Apple Unix." ${not_packaged_build})
cmake_dependent_option(TG_OWT_USE_PIPEWIRE "Use pipewire for desktop capture." ON "UNIX; NOT APPLE" OFF)
cmake_dependent_option(TG_OWT_DLOPEN_PIPEWIRE "dlopen pipewire for desktop capture." ${not_packaged_build} TG_OWT_USE_PIPEWIRE OFF)
option(TG_OWT_BUILD_AUDIO_BACKENDS "Build webrtc audio backends." OFF)

if (NOT UNIX OR APPLE)
set(TG_OWT_USE_PIPEWIRE OFF)
endif()

if (BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
message(WARNING
Expand Down
6 changes: 0 additions & 6 deletions cmake/init_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ function(init_target target_name) # init_target(my_target folder_name)
-Wno-narrowing
-Wno-return-type
)
if (NOT TG_OWT_SPECIAL_TARGET STREQUAL "" AND CMAKE_SIZEOF_VOID_P EQUAL 4)
target_compile_options(${target_name}
PRIVATE
-g0
)
endif()
endif()

if (is_x86)
Expand Down

0 comments on commit a5fbc91

Please sign in to comment.