diff --git a/MediaProcessor/CMakeLists.txt b/MediaProcessor/CMakeLists.txt index 5854ca5..d3d585c 100644 --- a/MediaProcessor/CMakeLists.txt +++ b/MediaProcessor/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -march=native -ffast-math -flto") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3 -march=native") include(FetchContent) set(FETCHCONTENT_BASE_DIR "${CMAKE_BINARY_DIR}/_deps") # helps with Docker to resolve diff --git a/MediaProcessor/cmake/src.cmake b/MediaProcessor/cmake/src.cmake index b2af199..8199ccb 100644 --- a/MediaProcessor/cmake/src.cmake +++ b/MediaProcessor/cmake/src.cmake @@ -5,7 +5,7 @@ add_executable(MediaProcessor ${CMAKE_SOURCE_DIR}/src/ConfigManager.cpp ${CMAKE_SOURCE_DIR}/src/AudioProcessor.cpp ${CMAKE_SOURCE_DIR}/src/VideoProcessor.cpp - ${CMAKE_SOURCE_DIR}/src/MediaProcessor.cpp + ${CMAKE_SOURCE_DIR}/src/Engine.cpp ${CMAKE_SOURCE_DIR}/src/Utils.cpp ${CMAKE_SOURCE_DIR}/src/CommandBuilder.cpp ${CMAKE_SOURCE_DIR}/src/HardwareUtils.cpp @@ -27,7 +27,15 @@ if(APPLE) # set(DF_LIBRARY ${CMAKE_SOURCE_DIR}/lib/libdf.dylib) endif() elseif(WIN32) - set(DF_LIBRARY ${CMAKE_SOURCE_DIR}/lib/libdf.dll.a) # .dll.a for linking, .dll for runtime + set(DF_LIBRARY ${CMAKE_SOURCE_DIR}/lib/libdf.dll.a) # for linktime + set(DF_DLL_PATH ${CMAKE_SOURCE_DIR}/lib/df.dll) # for runtime + + # Ensure the dll is present with the binary + add_custom_command(TARGET MediaProcessor POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${DF_DLL_PATH} + $) + elseif(UNIX) set(DF_LIBRARY ${CMAKE_SOURCE_DIR}/lib/libdf.so) else() @@ -35,14 +43,23 @@ else() endif() -target_link_libraries(MediaProcessor PRIVATE +# Base libraries +set(LIBRARIES Threads::Threads - ${SNDFILE_LIBRARIES} ${DF_LIBRARY} nlohmann_json::nlohmann_json fmt::fmt ) +# macos-specific library fixes +if(APPLE) + list(APPEND LIBRARIES /opt/homebrew/lib/libsndfile.dylib) +else() + list(APPEND LIBRARIES ${SNDFILE_LIBRARIES}) +endif() + +target_link_libraries(MediaProcessor PRIVATE ${LIBRARIES}) + target_compile_options(MediaProcessor PRIVATE -D_GLIBCXX_USE_CXX23_ABI) # Some of this was for macOS try to remove if possible @@ -51,5 +68,4 @@ set_target_properties(MediaProcessor PROPERTIES INSTALL_RPATH "${CMAKE_SOURCE_DIR}/lib" BUILD_RPATH "${CMAKE_SOURCE_DIR}/lib" INSTALL_RPATH_USE_LINK_PATH TRUE - INTERPROCEDURAL_OPTIMIZATION TRUE -) +) \ No newline at end of file diff --git a/MediaProcessor/lib/libdf.so b/MediaProcessor/lib/libdf.so index 9f829b8..4d6007f 100755 Binary files a/MediaProcessor/lib/libdf.so and b/MediaProcessor/lib/libdf.so differ