未验证 提交 d9408b51 编写于 作者: J Jim 提交者: GitHub

Merge pull request #3288 from makise-homura/e2k_support

E2k support
...@@ -62,6 +62,8 @@ set(SCRIPTING_ENABLED OFF CACHE BOOL "Internal global cmake variable" FORCE) ...@@ -62,6 +62,8 @@ set(SCRIPTING_ENABLED OFF CACHE BOOL "Internal global cmake variable" FORCE)
include(ObsHelpers) include(ObsHelpers)
include(ObsCpack) include(ObsCpack)
include(GNUInstallDirs) include(GNUInstallDirs)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
# Must be a string in the format of "x.x.x-rcx" # Must be a string in the format of "x.x.x-rcx"
if(DEFINED RELEASE_CANDIDATE) if(DEFINED RELEASE_CANDIDATE)
...@@ -120,7 +122,7 @@ else () ...@@ -120,7 +122,7 @@ else ()
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR) string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_SYSTEM_PROCESSOR)
endif () endif ()
if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86|x64|x86_64|amd64)") if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|x86|x64|x86_64|amd64|e2k)")
set(NEEDS_SIMDE "0") set(NEEDS_SIMDE "0")
if(NOT MSVC) if(NOT MSVC)
set(ARCH_SIMD_FLAGS "-mmmx" "-msse" "-msse2") set(ARCH_SIMD_FLAGS "-mmmx" "-msse" "-msse2")
...@@ -133,8 +135,16 @@ else() ...@@ -133,8 +135,16 @@ else()
set(NEEDS_SIMDE "1") set(NEEDS_SIMDE "1")
add_definitions(-DNEEDS_SIMDE=1) add_definitions(-DNEEDS_SIMDE=1)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp-simd -DSIMDE_ENABLE_OPENMP") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSIMDE_ENABLE_OPENMP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp-simd -DSIMDE_ENABLE_OPENMP") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSIMDE_ENABLE_OPENMP")
CHECK_C_COMPILER_FLAG("-fopenmp-simd" C_COMPILER_SUPPORTS_OPENMP_SIMD)
if(C_COMPILER_SUPPORTS_OPENMP_SIMD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp-simd")
endif()
CHECK_CXX_COMPILER_FLAG("-fopenmp-simd" CXX_COMPILER_SUPPORTS_OPENMP_SIMD)
if(CXX_COMPILER_SUPPORTS_OPENMP_SIMD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp-simd")
endif()
endif() endif()
set(ARCH_SIMD_FLAGS "") set(ARCH_SIMD_FLAGS "")
message(STATUS "No Native SSE2 SIMD Support - Using SIMDE") message(STATUS "No Native SSE2 SIMD Support - Using SIMDE")
...@@ -204,6 +214,21 @@ elseif(UNIX) ...@@ -204,6 +214,21 @@ elseif(UNIX)
endif() endif()
endif() endif()
if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "e2k")
foreach(TEST_C_FLAG "-Wno-unused-parameter" "-Wno-ignored-qualifiers" "-Wno-pointer-sign" "-Wno-unused-variable" "-Wno-sign-compare" "-Wno-bad-return-value-type" "-Wno-maybe-uninitialized")
CHECK_C_COMPILER_FLAG(${TEST_C_FLAG} C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG})
if(C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEST_C_FLAG}")
endif()
endforeach()
foreach(TEST_CXX_FLAG "-Wno-invalid-offsetof" "-Wno-maybe-uninitialized")
CHECK_CXX_COMPILER_FLAG(${TEST_CXX_FLAG} CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG})
if(CXX_COMPILER_SUPPORTS_FLAG_${TEST_CXX_FLAG})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_CXX_FLAG}")
endif()
endforeach()
endif()
option(BUILD_TESTS "Build test directory (includes test sources and possibly a platform test executable)" FALSE) option(BUILD_TESTS "Build test directory (includes test sources and possibly a platform test executable)" FALSE)
mark_as_advanced(BUILD_TESTS) mark_as_advanced(BUILD_TESTS)
......
...@@ -45,7 +45,7 @@ struct obs_x264_options obs_x264_parse_options(const char *options_string) ...@@ -45,7 +45,7 @@ struct obs_x264_options obs_x264_parse_options(const char *options_string)
struct obs_x264_option *out_option = out_options; struct obs_x264_option *out_option = out_options;
for (char **input_word = input_words; *input_word; ++input_word) { for (char **input_word = input_words; *input_word; ++input_word) {
if (getparam(*input_word, &out_option->name, if (getparam(*input_word, &out_option->name,
&out_option->value)) { (const char **)&out_option->value)) {
++out_option; ++out_option;
} else { } else {
*ignored_word = *input_word; *ignored_word = *input_word;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册