Sync vgsound_emu with master

This commit is contained in:
cam900 2022-10-20 11:44:48 +09:00
parent dc229078cc
commit e365a92f65
2 changed files with 83 additions and 4 deletions

View File

@ -2,6 +2,10 @@
## Important changes
### V 2.1.1 (2022-10-20)
Add C++11 detection for CMake
### V 2.1.0 (2022-09-08)
Move source folder into vgsound_emu folder

View File

@ -8,9 +8,11 @@
cmake_minimum_required(VERSION 3.0)
project(vgsound_emu
VERSION 2.1.0
VERSION 2.1.1
LANGUAGES CXX)
enable_language(CXX)
option(VGSOUND_EMU_ES5504 "Use ES5504 core" ON)
option(VGSOUND_EMU_ES5505 "Use ES5505 core" ON)
option(VGSOUND_EMU_ES5506 "Use ES5506 core" ON)
@ -31,19 +33,80 @@ message(STATUS "Generator: ${CMAKE_GENERATOR}")
message(STATUS "Extra generator: ${CMAKE_EXTRA_GENERATOR}")
message(STATUS "Make program: ${CMAKE_MAKE_PROGRAM}")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.1.0")
message(STATUS "Generating C++11 compile features:")
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.8.0")
set(cxx_features cxx_std_11)
else()
set(cxx_features
cxx_template_template_parameters
cxx_alias_templates
cxx_alignas
cxx_alignof
cxx_attributes
cxx_auto_type
cxx_constexpr
cxx_decltype
cxx_decltype_incomplete_return_types
cxx_default_function_template_args
cxx_defaulted_functions
cxx_defaulted_move_initializers
cxx_delegating_constructors
cxx_deleted_functions
cxx_enum_forward_declarations
cxx_explicit_conversions
cxx_extended_friend_declarations
cxx_extern_templates
cxx_final
cxx_func_identifier
cxx_generalized_initializers
cxx_inheriting_constructors
cxx_inline_namespaces
cxx_lambdas
cxx_local_type_template_args
cxx_long_long_type
cxx_noexcept
cxx_nonstatic_member_init
cxx_nullptr
cxx_override
cxx_range_for
cxx_raw_string_literals
cxx_reference_qualified_functions
cxx_right_angle_brackets
cxx_rvalue_references
cxx_sizeof_member
cxx_static_assert
cxx_strong_enums
cxx_thread_local
cxx_trailing_return_types
cxx_unicode_literals
cxx_uniform_initialization
cxx_unrestricted_unions
cxx_user_literals
cxx_variadic_macros
cxx_variadic_templates)
endif()
message(STATUS "${cxx_features}")
endif()
set(CORE_SOURCE "")
set(EMU_SOURCE "")
# Core functions
list(APPEND CORE_SOURCE
vgsound_emu/src/core/util.hpp
vgsound_emu/src/core/core.hpp
vgsound_emu/src/core/util/clock_pulse.hpp
vgsound_emu/src/core/util/fifo.hpp
vgsound_emu/src/core/util/mem_intf.hpp
)
# Dialogic ADPCM
if(VGSOUND_EMU_MSM6295)
list(APPEND CORE_SOURCE
vgsound_emu/src/core/vox/vox.cpp
vgsound_emu/src/core/vox/vox.hpp
vgsound_emu/src/core/vox/vox.cpp
)
message(STATUS "Using Dialogic ADPCM core")
endif()
@ -156,6 +219,18 @@ if(VGSOUND_EMU_X1_010)
endif()
add_library(vgsound_emu STATIC ${CORE_SOURCE} ${EMU_SOURCE})
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.1.0")
set_target_properties(vgsound_emu
PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)
target_compile_features(vgsound_emu PRIVATE ${cxx_features})
message(STATUS "C++11 Enabled")
endif()
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
# target_compile_options(vgsound_emu PRIVATE -Wall -Werror)
# for Test purpose (GCC)
# target_compile_options(vgsound_emu PRIVATE -Wall -Wextra -Werror)