Linux CMake improvements:
* Disable warning output during configuration. * Allow users to turn on warnings for ffmpeg and other internal projects. * Add a new variable for easier ffmpeg version migration if we ever * pursue that.
This commit is contained in:
@@ -31,11 +31,13 @@ function(sm_add_link_flag target flag)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(disable_project_warnings projectName)
|
function(disable_project_warnings projectName)
|
||||||
if (MSVC)
|
if (NOT WITH_EXTERNAL_WARNINGS)
|
||||||
sm_add_compile_flag(${projectName} "/W0")
|
if (MSVC)
|
||||||
elseif(APPLE)
|
sm_add_compile_flag(${projectName} "/W0")
|
||||||
set_target_properties(${projectName} PROPERTIES XCODE_ATTRIBUTE_GCC_WARN_INHIBIT_ALL_WARNINGS "YES")
|
elseif(APPLE)
|
||||||
else()
|
set_target_properties(${projectName} PROPERTIES XCODE_ATTRIBUTE_GCC_WARN_INHIBIT_ALL_WARNINGS "YES")
|
||||||
set_target_properties(${projectName} PROPERTIES COMPILE_FLAGS "-w")
|
else()
|
||||||
|
set_target_properties(${projectName} PROPERTIES COMPILE_FLAGS "-w")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|||||||
+15
-7
@@ -41,9 +41,13 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Rhythm Game Simulator")
|
|||||||
# Prep options that are needed for each platform.
|
# Prep options that are needed for each platform.
|
||||||
option(WITH_NETWORKING "Build with networking support." ON)
|
option(WITH_NETWORKING "Build with networking support." ON)
|
||||||
|
|
||||||
|
# This option quiets warnings that are a part of external projects.
|
||||||
|
option(WITH_EXTERNAL_WARNINGS "Build with warnings for all components, not just StepMania." OFF)
|
||||||
|
|
||||||
# This option is not yet working, but will likely default to ON in the future.
|
# This option is not yet working, but will likely default to ON in the future.
|
||||||
option(WITH_LTO "Build with Link Time Optimization (LTO)/Whole Program Optimization." OFF)
|
option(WITH_LTO "Build with Link Time Optimization (LTO)/Whole Program Optimization." OFF)
|
||||||
|
|
||||||
|
# This option handles if we use SSE2 processing.
|
||||||
option(WITH_SSE2 "Build with SSE2 Optimizations." ON)
|
option(WITH_SSE2 "Build with SSE2 Optimizations." ON)
|
||||||
|
|
||||||
# This option may go away in the future: if it does, JPEG will always be required.
|
# This option may go away in the future: if it does, JPEG will always be required.
|
||||||
@@ -296,7 +300,8 @@ elseif(LINUX)
|
|||||||
set(HAS_FFMPEG TRUE)
|
set(HAS_FFMPEG TRUE)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(SM_FFMPEG_SRC_DIR "${SM_EXTERN_DIR}/ffmpeg-linux-2.1.3")
|
set(SM_FFMPEG_VERSION "2.1.3")
|
||||||
|
string(CONCAT SM_FFMPEG_SRC_DIR "${SM_EXTERN_DIR}" "/ffmpeg-linux-" "${SM_FFMPEG_VERSION}")
|
||||||
set(SM_FFMPEG_ROOT "${CMAKE_BINARY_DIR}/ffmpeg-prefix/src/ffmpeg-build")
|
set(SM_FFMPEG_ROOT "${CMAKE_BINARY_DIR}/ffmpeg-prefix/src/ffmpeg-build")
|
||||||
list(APPEND FFMPEG_CONFIGURE
|
list(APPEND FFMPEG_CONFIGURE
|
||||||
"${SM_FFMPEG_SRC_DIR}/configure"
|
"${SM_FFMPEG_SRC_DIR}/configure"
|
||||||
@@ -314,6 +319,13 @@ elseif(LINUX)
|
|||||||
"--enable-gpl"
|
"--enable-gpl"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (NOT WITH_EXTERNAL_WARNINGS)
|
||||||
|
list(APPEND FFMPEG_CONFIGURE
|
||||||
|
"--extra-cflags=-w"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (IS_DIRECTORY "${SM_FFMPEG_SRC_DIR}")
|
if (IS_DIRECTORY "${SM_FFMPEG_SRC_DIR}")
|
||||||
externalproject_add("ffmpeg"
|
externalproject_add("ffmpeg"
|
||||||
SOURCE_DIR "${SM_FFMPEG_SRC_DIR}"
|
SOURCE_DIR "${SM_FFMPEG_SRC_DIR}"
|
||||||
@@ -326,12 +338,8 @@ elseif(LINUX)
|
|||||||
else()
|
else()
|
||||||
# --shlibdir=$our_installdir/stepmania-$VERSION
|
# --shlibdir=$our_installdir/stepmania-$VERSION
|
||||||
externalproject_add("ffmpeg"
|
externalproject_add("ffmpeg"
|
||||||
# DOWNLOAD_DIR "${SM_EXTERN_DIR}/ffmpeg-linux"
|
DOWNLOAD_COMMAND git clone "--branch" "n${SM_FFMPEG_VERSION}" "--depth" "1" "git://source.ffmpeg.org/ffmpeg.git" "${SM_FFMPEG_SRC_DIR}"
|
||||||
# PREFIX "${SM_EXTERN_DIR}/ffmpeg-linux"
|
CONFIGURE_COMMAND "${FFMPEG_CONFIGURE}"
|
||||||
# GIT_REPOSITORY "git://source.ffmpeg.org/ffmpeg.git"
|
|
||||||
# GIT_TAG "n2.1.3"
|
|
||||||
DOWNLOAD_COMMAND git clone "--branch" "n2.1.3" "--depth" "1" "git://source.ffmpeg.org/ffmpeg.git" "${SM_FFMPEG_SRC_DIR}"
|
|
||||||
CONFIGURE_COMMAND ${FFMPEG_CONFIGURE}
|
|
||||||
BUILD_COMMAND "make"
|
BUILD_COMMAND "make"
|
||||||
UPDATE_COMMAND ""
|
UPDATE_COMMAND ""
|
||||||
INSTALL_COMMAND ""
|
INSTALL_COMMAND ""
|
||||||
|
|||||||
Reference in New Issue
Block a user