Skip to content

Commit 64e1de2

Browse files
committed
set default C/C++ standard to C90 and C++98
1 parent 6a5daaf commit 64e1de2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ endif()
1212

1313
project(libvgmMain VERSION 0.1 LANGUAGES C CXX)
1414

15-
set(CMAKE_CXX_STANDARD 14)
15+
set(CMAKE_C_STANDARD 90)
16+
set(CMAKE_CXX_STANDARD 98)
1617

1718
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/libs/cmake_modules/")
1819

@@ -130,6 +131,7 @@ option(BUILD_PLAYER "build player application" ON)
130131
option(BUILD_VGM2WAV "build sample vgm2wav application" ON)
131132
set(LIBRARY_TYPE "STATIC" CACHE STRING "library build type (static/shared)")
132133
set_property(CACHE LIBRARY_TYPE PROPERTY STRINGS "SHARED;STATIC")
134+
option(REALLY_NEED_CXX14 "I really need C++14" OFF)
133135
option(USE_SANITIZERS "use sanitizers" ON)
134136

135137

emu/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ option(SNDEMU_MSM5205_ALL "Sound Device MSM5205: all cores" OFF)
8686
option(SNDEMU_MSM5232_ALL "Sound Device MSM5232: all cores" OFF)
8787
option(SNDEMU_BSMT2000_ALL "Sound Device BSMT2000: all cores" OFF)
8888
option(SNDEMU_ICS2115_ALL "Sound Device ICS2115: all cores" OFF)
89+
if(REALLY_NEED_CXX14)
8990
option(SNDEMU_YM2414_YMFM "Sound Device YM2414 (OPZ): ymfm core" OFF)
91+
endif()
9092

9193
# console/computer presets
9294
option(SNDEMU__PRESET_SMS "Sound Dev. Preset: Sega Master System/Game Gear" OFF)
@@ -650,6 +652,9 @@ if(SNDEMU_ICS2115_ALL)
650652
set(EMU_FILES ${EMU_FILES} cores/ics2115.c)
651653
set(EMU_CORE_HEADERS ${EMU_CORE_HEADERS} cores/ics2115.h)
652654
endif()
655+
if(NOT REALLY_NEED_CXX14)
656+
set(SNDEMU_YM2414_YMFM OFF)
657+
endif()
653658
if(SNDEMU_YM2414_YMFM)
654659
set(EMU_DEFS ${EMU_DEFS} " SNDDEV_YM2414" " EC_YM2414_YMFM")
655660
set(EMU_FILES ${EMU_FILES} cores/ymfmintf.cpp cores/ymfm/ymfm_opz.cpp)
@@ -662,6 +667,9 @@ if(SNDEMU_YM2414_YMFM)
662667
endif()
663668

664669
add_library(${PROJECT_NAME} ${LIBRARY_TYPE} ${EMU_FILES})
670+
if(REALLY_NEED_CXX14)
671+
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14)
672+
endif()
665673
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
666674
target_compile_definitions(${PROJECT_NAME} PUBLIC ${EMU_DEFS})
667675
target_include_directories(${PROJECT_NAME}

emu/SoundDevs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@
4949
#define DEVID_MSM5232 0x2D
5050
#define DEVID_BSMT2000 0x2E
5151
#define DEVID_ICS2115 0x2F
52-
#define DEVID_YM2414 0x30 // YM2414 (OPZ), used in TX81Z
52+
#define DEVID_YM2414 0x81 // YM2414 (OPZ), used in TX81Z
53+
5354
#endif // __SOUNDDEVS_H__

0 commit comments

Comments
 (0)