Skip to content

Commit

Permalink
cmake: fix build with ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 committed Oct 13, 2024
1 parent add1de6 commit fe56180
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,17 @@ add_custom_command(
add_custom_target(ffmpeg-configure DEPENDS ${FFMPEG_PATH}/config.h)

function(import_ffmpeg_library name)
if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(MAKE_COMMAND $(MAKE) -j$(nproc))
elseif (${CMAKE_GENERATOR} STREQUAL "Ninja")
set(MAKE_COMMAND make -j$$(nproc))
else()
set(MAKE_COMMAND make)
endif()

add_custom_command(
OUTPUT "${FFMPEG_PATH}/lib${name}/lib${name}.a"
COMMAND $(MAKE) -C ${FFMPEG_PATH} "lib${name}/lib${name}.a"
COMMAND ${MAKE_COMMAND} -C ${FFMPEG_PATH} "lib${name}/lib${name}.a"
COMMENT "Building lib${name}/lib${name}.a"
DEPENDS ffmpeg-configure
WORKING_DIRECTORY ${FFMPEG_PATH}
Expand Down

0 comments on commit fe56180

Please sign in to comment.