Skip to content

Commit

Permalink
CMakeLists: add conditional build with DRC (#198)
Browse files Browse the repository at this point in the history
* CMakeLists: add conditional build with DRC

This is commit 340dae8, but for CMake
as it got lost during the conversion from Autotools to CMake.

* CMakeLists: prepend FAAD to option name

... so that all option() names begin with FAAD_.
  • Loading branch information
JohannesKauffmann authored Dec 31, 2023
1 parent 677918d commit c8eae3e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ endif()

# Lets stick to predefined config, until more flexibility is actually requested.
set(FAAD_DEFINES
APPLY_DRC
HAVE_INTTYPES_H=1
HAVE_MEMCPY=1
HAVE_STRING_H=1
Expand All @@ -107,6 +106,13 @@ set(FAAD_DEFINES
PACKAGE_VERSION=\"${FAAD_VERSION}\"
)

option(FAAD_APPLY_DRC "Apply dynamic range control" ON)
if(FAAD_APPLY_DRC)
list(APPEND FAAD_DEFINES
APPLY_DRC
)
endif()

check_library_exists(m lrintf "" HAVE_LIBM)
if(HAVE_LIBM)
list(APPEND CMAKE_REQUIRED_LIBRARIES m)
Expand Down Expand Up @@ -245,8 +251,8 @@ foreach(LIB faad faad_drm faad_fixed faad_drm_fixed)
endforeach()

# CLI
option(BUILD_FAAD_CLI "Build faad_cli executable" ON)
if (BUILD_FAAD_CLI)
option(FAAD_BUILD_CLI "Build faad_cli executable" ON)
if (FAAD_BUILD_CLI)
add_executable(faad_cli ${FAAD_SOURCES})
target_link_libraries(faad_cli faad)
target_compile_definitions(faad_cli PRIVATE ${FAAD_DEFINES})
Expand All @@ -267,7 +273,7 @@ if(NOT FAAD_BUNDLED_MODE AND NOT MSVC)
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")

set(INSTALL_TARGETS faad faad_drm)
if (BUILD_FAAD_CLI)
if (FAAD_BUILD_CLI)
list(APPEND INSTALL_TARGETS faad_cli)
endif()

Expand Down

0 comments on commit c8eae3e

Please sign in to comment.