Commit dfd6839b authored by Ghislain MARY's avatar Ghislain MARY

Only define the static only option for the desktop config.

parent 2fba79dd
......@@ -140,6 +140,34 @@ if(CMAKE_TOOLCHAIN_FILE)
endif()
# This macro can be used to add an option. Give it option name and description,
# default value and optionally dependent predicate and value
macro(linphone_builder_add_dependent_option NAME DESCRIPTION DEFAULT_VALUE CONDITION CONDITION_VALUE)
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
cmake_dependent_option(ENABLE_${UPPERCASE_NAME} "${DESCRIPTION}" "${DEFAULT_VALUE}" "${CONDITION}" "${CONDITION_VALUE}")
add_feature_info("${NAME}" "ENABLE_${UPPERCASE_NAME}" "${DESCRIPTION}")
endmacro()
macro(linphone_builder_add_strict_dependent_option NAME DESCRIPTION DEFAULT_VALUE CONDITION CONDITION_VALUE STRICT_CONDITION ERROR_MSG)
linphone_builder_add_dependent_option("${NAME}" "${DESCRIPTION}" "${DEFAULT_VALUE}" "${CONDITION}" "${CONDITION_VALUE}")
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
if(${ENABLE_${UPPERCASE_NAME}} AND NOT ${STRICT_CONDITION})
message(FATAL_ERROR "Trying to enable ${NAME} but ${ERROR_MSG}")
endif()
endmacro()
macro(linphone_builder_add_option NAME DESCRIPTION DEFAULT_VALUE)
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
option(ENABLE_${UPPERCASE_NAME} "Enable ${NAME}: ${DESCRIPTION}" "${DEFAULT_VALUE}")
add_feature_info("${NAME}" "ENABLE_${UPPERCASE_NAME}" "${DESCRIPTION}")
endmacro()
macro(linphone_builder_get_autotools_configuration)
if(MSVC)
set(_generator "MinGW Makefiles")
......
......@@ -19,7 +19,14 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
############################################################################
if (ENABLE_STATIC_ONLY)
# Define options that are specific to the desktop config
linphone_builder_add_option("Theora" "Theora video encoding/decoding support." "${DEFAULT_VALUE_ENABLE_THEORA}")
linphone_builder_add_option("Static only" "Enable compilation of libraries in static mode." "${DEFAULT_VALUE_ENABLE_STATIC_ONLY}")
if(ENABLE_STATIC_ONLY)
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_SHARED=NO" "-DENABLE_STATIC=YES")
else()
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_SHARED=YES" "-DENABLE_STATIC=NO")
......@@ -83,13 +90,6 @@ endif()
# Include builders
include(builders/CMakeLists.txt)
# Define options that are specific to the desktop config
add_option("Theora" "Theora video encoding/decoding support." "${DEFAULT_VALUE_ENABLE_THEORA}")
# linphone
if(WIN32)
linphone_builder_add_cmake_option(linphone "-DENABLE_RELATIVE_PREFIX=YES")
......@@ -113,7 +113,7 @@ if(NOT WIN32)
set(EP_opencoreamr_EXTRA_LDFLAGS "${EP_opencoreamr_EXTRA_LDFLAGS} -fPIC")
endif()
if (ENABLE_STATIC_ONLY)
if(ENABLE_STATIC_ONLY)
# ffmpeg
set(EP_ffmpeg_LINKING_TYPE "--enable-static" "--disable-shared" "--enable-pic")
......
......@@ -37,7 +37,7 @@ set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_WASAPI OFF)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_STATIC_ONLY FALSE)
message(STATUS "Buiding for Raspberry PI ${RASPBERRY_VERSION}")
......
......@@ -37,7 +37,6 @@ set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_WASAPI ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_STATIC_ONLY FALSE)
include(configs/config-desktop-common.cmake)
......
......@@ -20,37 +20,6 @@
#
############################################################################
# Helper macros to help define options
# This macro can be used to add an option. Give it option name and description,
# default value and optionally dependent predicate and value
macro(add_dependent_option NAME DESCRIPTION DEFAULT_VALUE CONDITION CONDITION_VALUE)
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
cmake_dependent_option(ENABLE_${UPPERCASE_NAME} "${DESCRIPTION}" "${DEFAULT_VALUE}" "${CONDITION}" "${CONDITION_VALUE}")
add_feature_info("${NAME}" "ENABLE_${UPPERCASE_NAME}" "${DESCRIPTION}")
endmacro()
macro(add_strict_dependent_option NAME DESCRIPTION DEFAULT_VALUE CONDITION CONDITION_VALUE STRICT_CONDITION ERROR_MSG)
add_dependent_option("${NAME}" "${DESCRIPTION}" "${DEFAULT_VALUE}" "${CONDITION}" "${CONDITION_VALUE}")
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
if(${ENABLE_${UPPERCASE_NAME}} AND NOT ${STRICT_CONDITION})
message(FATAL_ERROR "Trying to enable ${NAME} but ${ERROR_MSG}")
endif()
endmacro()
macro(add_option NAME DESCRIPTION DEFAULT_VALUE)
string(TOUPPER ${NAME} UPPERCASE_NAME)
string(REGEX REPLACE " " "_" UPPERCASE_NAME ${UPPERCASE_NAME})
string(REGEX REPLACE "\\+" "P" UPPERCASE_NAME ${UPPERCASE_NAME})
option(ENABLE_${UPPERCASE_NAME} "Enable ${NAME}: ${DESCRIPTION}" "${DEFAULT_VALUE}")
add_feature_info("${NAME}" "ENABLE_${UPPERCASE_NAME}" "${DESCRIPTION}")
endmacro()
# Common build options
option(ENABLE_UNIT_TESTS "Enable unit tests support with BCUnit library." "${DEFAULT_VALUE_ENABLE_UNIT_TESTS}")
......
......@@ -33,5 +33,3 @@ if(UNIX AND NOT IOS)
option(ENABLE_RELATIVE_PREFIX "liblinphone and mediastreamer will look for their respective ressources relatively to their location." OFF)
add_feature_info("Relative prefix" ENABLE_RELATIVE_PREFIX "liblinphone and mediastreamer will look for their respective ressources relatively to their location.")
endif()
option(ENABLE_STATIC_ONLY "Enable compilation of libraries in static mode" ${DEFAULT_VALUE_ENABLE_STATIC_ONLY})
add_feature_info("Static only" ENABLE_STATIC_ONLY "Enable compilation of libraries in static mode.")
......@@ -22,48 +22,48 @@
# Mediastreamer2 build options
add_option("GPL third parties" "Usage of GPL third-party code (FFmpeg and x264)." "${DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES}")
add_option("Non free codecs" "Allow inclusion of non-free codecs in the build." OFF)
linphone_builder_add_option("GPL third parties" "Usage of GPL third-party code (FFmpeg and x264)." "${DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES}")
linphone_builder_add_option("Non free codecs" "Allow inclusion of non-free codecs in the build." OFF)
#security options
add_option("SRTP" "SRTP media encryption support." "${DEFAULT_VALUE_ENABLE_SRTP}")
add_dependent_option("ZRTP" "ZRTP media encryption support." "${DEFAULT_VALUE_ENABLE_ZRTP}" "ENABLE_SRTP" OFF)
linphone_builder_add_option("SRTP" "SRTP media encryption support." "${DEFAULT_VALUE_ENABLE_SRTP}")
linphone_builder_add_dependent_option("ZRTP" "ZRTP media encryption support." "${DEFAULT_VALUE_ENABLE_ZRTP}" "ENABLE_SRTP" OFF)
#audio options and codecs
add_option("WebRTC AEC" "WebRTC echo canceller support." "${DEFAULT_VALUE_ENABLE_WEBRTC_AEC}")
add_dependent_option("WASAPI" "Windows Audio Session API (WASAPI) sound card support." "${DEFAULT_VALUE_ENABLE_WASAPI}" "MSVC" OFF)
add_strict_dependent_option("AMRNB" "AMR narrow-band audio encoding/decoding support (require license)." OFF ON OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
add_strict_dependent_option("AMRWB" "AMR wide-band audio encoding/decoding support (require license)." OFF ON OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_option("WebRTC AEC" "WebRTC echo canceller support." "${DEFAULT_VALUE_ENABLE_WEBRTC_AEC}")
linphone_builder_add_dependent_option("WASAPI" "Windows Audio Session API (WASAPI) sound card support." "${DEFAULT_VALUE_ENABLE_WASAPI}" "MSVC" OFF)
linphone_builder_add_strict_dependent_option("AMRNB" "AMR narrow-band audio encoding/decoding support (require license)." OFF ON OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_strict_dependent_option("AMRWB" "AMR wide-band audio encoding/decoding support (require license)." OFF ON OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
if(ENABLE_AMRNB OR ENABLE_AMRWB)
set(ENABLE_AMR ON CACHE BOOL "" FORCE)
endif()
add_option("Codec2" "Codec2 audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_CODEC2}")
add_strict_dependent_option("G729" "G.729 audio encoding/decoding support (require license)." OFF ON OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
add_strict_dependent_option("G729B CNG" "G.729 annex B confort noise generation (require license)." OFF ON OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
add_option("G726" "G.726 audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_G726}")
add_option("GSM" "GSM audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_GSM}")
add_option("iLBC" "iLBC audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_ILBC}")
add_option("ISAC" "ISAC audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_ISAC}")
add_option("OPUS" "OPUS audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_OPUS}")
add_option("Silk" "Silk audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_SILK}")
add_option("Speex" "Speex audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_SPEEX}")
add_option("BV16" "BroadVoice 16 audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_BV16}")
linphone_builder_add_option("Codec2" "Codec2 audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_CODEC2}")
linphone_builder_add_strict_dependent_option("G729" "G.729 audio encoding/decoding support (require license)." OFF ON OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_strict_dependent_option("G729B CNG" "G.729 annex B confort noise generation (require license)." OFF ON OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_option("G726" "G.726 audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_G726}")
linphone_builder_add_option("GSM" "GSM audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_GSM}")
linphone_builder_add_option("iLBC" "iLBC audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_ILBC}")
linphone_builder_add_option("ISAC" "ISAC audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_ISAC}")
linphone_builder_add_option("OPUS" "OPUS audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_OPUS}")
linphone_builder_add_option("Silk" "Silk audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_SILK}")
linphone_builder_add_option("Speex" "Speex audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_SPEEX}")
linphone_builder_add_option("BV16" "BroadVoice 16 audio encoding/decoding support." "${DEFAULT_VALUE_ENABLE_BV16}")
#video options and codecs
add_option("Video" "Ability to capture and display video." "${DEFAULT_VALUE_ENABLE_VIDEO}")
linphone_builder_add_option("Video" "Ability to capture and display video." "${DEFAULT_VALUE_ENABLE_VIDEO}")
# FFMpeg is LGPL which is an issue only for iOS applications; otherwise it can be used in proprietary software as well
if (IOS)
add_strict_dependent_option("FFmpeg" "Some video processing features via FFmpeg: JPEG encoding/decoding, video scaling, H264 decoding..." "${DEFAULT_VALUE_ENABLE_FFMPEG}" "ENABLE_VIDEO" OFF "ENABLE_GPL_THIRD_PARTIES" "GPL third parties not enabled (ENABLE_GPL_THIRD_PARTIES).")
linphone_builder_add_strict_dependent_option("FFmpeg" "Some video processing features via FFmpeg: JPEG encoding/decoding, video scaling, H264 decoding..." "${DEFAULT_VALUE_ENABLE_FFMPEG}" "ENABLE_VIDEO" OFF "ENABLE_GPL_THIRD_PARTIES" "GPL third parties not enabled (ENABLE_GPL_THIRD_PARTIES).")
else()
add_dependent_option("FFmpeg" "Some video processing features via FFmpeg: JPEG encoding/decoding, video scaling, H264 decoding..." "${DEFAULT_VALUE_ENABLE_FFMPEG}" "ENABLE_VIDEO" OFF)
linphone_builder_add_dependent_option("FFmpeg" "Some video processing features via FFmpeg: JPEG encoding/decoding, video scaling, H264 decoding..." "${DEFAULT_VALUE_ENABLE_FFMPEG}" "ENABLE_VIDEO" OFF)
endif()
add_strict_dependent_option("H263" "H263 video encoding/decoding support (require license)." OFF "ENABLE_FFMPEG" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
add_strict_dependent_option("H263p" "H263+ video encoding/decoding support (require license)." OFF "ENABLE_FFMPEG" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
add_option("MKV" "MKV playing and recording support." "${DEFAULT_VALUE_ENABLE_MKV}")
add_strict_dependent_option("MPEG4" "MPEG4 video encoding/decoding support (require license)." OFF "ENABLE_FFMPEG" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
add_strict_dependent_option("OpenH264" "H.264 video encoding/decoding support with the openh264 library (require license)." OFF "ENABLE_VIDEO" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
add_dependent_option("V4L" "V4L camera driver." ON "ENABLE_VIDEO;UNIX;NOT APPLE;NOT QNX;NOT ANDROID" OFF)
add_dependent_option("VPX" "VPX (VP8) video encoding/decoding support." "${DEFAULT_VALUE_ENABLE_VPX}" "ENABLE_VIDEO" OFF)
add_strict_dependent_option("X264" "H.264 video encoding support with the x264 library (require license)." OFF "ENABLE_VIDEO;ENABLE_GPL_THIRD_PARTIES" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_strict_dependent_option("H263" "H263 video encoding/decoding support (require license)." OFF "ENABLE_FFMPEG" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_strict_dependent_option("H263p" "H263+ video encoding/decoding support (require license)." OFF "ENABLE_FFMPEG" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_option("MKV" "MKV playing and recording support." "${DEFAULT_VALUE_ENABLE_MKV}")
linphone_builder_add_strict_dependent_option("MPEG4" "MPEG4 video encoding/decoding support (require license)." OFF "ENABLE_FFMPEG" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_strict_dependent_option("OpenH264" "H.264 video encoding/decoding support with the openh264 library (require license)." OFF "ENABLE_VIDEO" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
linphone_builder_add_dependent_option("V4L" "V4L camera driver." ON "ENABLE_VIDEO;UNIX;NOT APPLE;NOT QNX;NOT ANDROID" OFF)
linphone_builder_add_dependent_option("VPX" "VPX (VP8) video encoding/decoding support." "${DEFAULT_VALUE_ENABLE_VPX}" "ENABLE_VIDEO" OFF)
linphone_builder_add_strict_dependent_option("X264" "H.264 video encoding support with the x264 library (require license)." OFF "ENABLE_VIDEO;ENABLE_GPL_THIRD_PARTIES" OFF "ENABLE_NON_FREE_CODECS" "non free codecs option not enabled (ENABLE_NON_FREE_CODECS).")
# Other options
add_option("PCAP" "PCAP support." "${DEFAULT_VALUE_ENABLE_PCAP}")
linphone_builder_add_option("PCAP" "PCAP support." "${DEFAULT_VALUE_ENABLE_PCAP}")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment