cmake_minimum_required(VERSION 3.22.1)
project(TapeveilLAME LANGUAGES C)
if(NOT LAME_SOURCE)
  message(FATAL_ERROR "LAME_SOURCE must point to the supplied 3.100 source with config.h")
endif()
file(GLOB LAME_SOURCES "${LAME_SOURCE}/libmp3lame/*.c")
add_library(tapeveil_lame SHARED ${LAME_SOURCES})
target_compile_definitions(tapeveil_lame PRIVATE HAVE_CONFIG_H=1)
target_include_directories(tapeveil_lame PRIVATE "${LAME_SOURCE}" "${LAME_SOURCE}/include" "${LAME_SOURCE}/mpglib")
target_compile_options(tapeveil_lame PRIVATE -O3)
target_link_libraries(tapeveil_lame m)
target_link_options(tapeveil_lame PRIVATE -Wl,-z,max-page-size=16384)
