sources = files(
    'Autofire.cc',
    'CLIOption.cc',
    'CartridgeSlotManager.cc',
    'ChakkariCopy.cc',
    'CliExtension.cc',
    'CommandLineParser.cc',
    'Connector.cc',
    'DebugDevice.cc',
    'DeviceFactory.cc',
    'DummyDevice.cc',
    'DummyPrinterPortDevice.cc',
    'DynamicClock.cc',
    'EmptyPatch.cc',
    'EmuTime.cc',
    'FirmwareSwitch.cc',
    'GlobalSettings.cc',
    'I8255.cc',
    'IPSPatch.cc',
    'LedStatus.cc',
    'MSXBunsetsu.cc',
    'MSXCielTurbo.cc',
    'MSXDevice.cc',
    'MSXDeviceSwitch.cc',
    'MSXE6Timer.cc',
    'MSXHiResTimer.cc',
    'MSXKanji.cc',
    'MSXKanji12.cc',
    'MSXMatsushita.cc',
    'MSXMotherBoard.cc',
    'MSXPPI.cc',
    'MSXPrinterPort.cc',
    'MSXRTC.cc',
    'MSXResetStatusRegister.cc',
    'MSXS1985.cc',
    'MSXS1990.cc',
    'MSXSwitchedDevice.cc',
    'MSXTurboRPause.cc',
    'MSXVictorHC9xSystemControl.cc',
    'PasswordCart.cc',
    'Pluggable.cc',
    'PluggableFactory.cc',
    'PluggingController.cc',
    'Printer.cc',
    'PrinterPortDevice.cc',
    'PrinterPortLogger.cc',
    'PrinterPortSimpl.cc',
    'RP5C01.cc',
    'RTSchedulable.cc',
    'RTScheduler.cc',
    'Reactor.cc',
    'RealTime.cc',
    'RenShaTurbo.cc',
    'ReplayCLI.cc',
    'ReverseManager.cc',
    'SVIPPI.cc',
    'SVIPrinterPort.cc',
    'SaveStateCLI.cc',
    'Schedulable.cc',
    'Scheduler.cc',
    'SensorKid.cc',
    'SpeedManager.cc',
    'ThrottleManager.cc',
    'Version.cc',
    'cassette/CasImage.cc',
    'cassette/CassetteDevice.cc',
    'cassette/CassetteImage.cc',
    'cassette/CassettePlayer.cc',
    'cassette/CassettePlayerCLI.cc',
    'cassette/CassettePort.cc',
    'cassette/DummyCassetteDevice.cc',
    'cassette/WavImage.cc',
    'commands/Command.cc',
    'commands/CommandException.cc',
    'commands/Completer.cc',
    'commands/GlobalCommandController.cc',
    'commands/InfoCommand.cc',
    'commands/InfoTopic.cc',
    'commands/Interpreter.cc',
    'commands/MSXCommandController.cc',
    'commands/ProxyCommand.cc',
    'commands/TclArgParser.cc',
    'commands/TclCallback.cc',
    'commands/TclObject.cc',
    'commands/TclParser.cc',
    'config/DeviceConfig.cc',
    'config/HardwareConfig.cc',
    'config/SettingsConfig.cc',
    'config/XMLElement.cc',
    'config/XMLLoader.cc',
    'console/CommandConsole.cc',
    'console/OSDConsoleRenderer.cc',
    'console/OSDGUI.cc',
    'console/OSDGUILayer.cc',
    'console/OSDImageBasedWidget.cc',
    'console/OSDRectangle.cc',
    'console/OSDText.cc',
    'console/OSDTopWidget.cc',
    'console/OSDWidget.cc',
    'console/TTFFont.cc',
    'cpu/BreakPointBase.cc',
    'cpu/CPUClock.cc',
    'cpu/CPUCore.cc',
    'cpu/CPURegs.cc',
    'cpu/Dasm.cc',
    'cpu/IRQHelper.cc',
    'cpu/MSXCPU.cc',
    'cpu/MSXCPUInterface.cc',
    'cpu/MSXMultiDevice.cc',
    'cpu/MSXMultiIODevice.cc',
    'cpu/MSXMultiMemDevice.cc',
    'cpu/MSXWatchIODevice.cc',
    'cpu/VDPIODelay.cc',
    'debugger/DasmTables.cc',
    'debugger/Debugger.cc',
    'debugger/Probe.cc',
    'debugger/ProbeBreakPoint.cc',
    'debugger/SimpleDebuggable.cc',
    'events/AdhocCliCommParser.cc',
    'events/AfterCommand.cc',
    'events/CliComm.cc',
    'events/CliConnection.cc',
    'events/CliServer.cc',
    'events/Event.cc',
    'events/EventDistributor.cc',
    'events/GlobalCliComm.cc',
    'events/HotKey.cc',
    'events/InputEventFactory.cc',
    'events/InputEventGenerator.cc',
    'events/InputEvents.cc',
    'events/Keys.cc',
    'events/MSXCliComm.cc',
    'events/MessageCommand.cc',
    'events/Socket.cc',
    'events/StdioMessages.cc',
    'events/TclCallbackMessages.cc',
    'fdc/AVTFDC.cc',
    'fdc/BootBlocks.cc',
    'fdc/DMKDiskImage.cc',
    'fdc/DSKDiskImage.cc',
    'fdc/DirAsDSK.cc',
    'fdc/Disk.cc',
    'fdc/DiskChanger.cc',
    'fdc/DiskContainer.cc',
    'fdc/DiskDrive.cc',
    'fdc/DiskFactory.cc',
    'fdc/DiskImageCLI.cc',
    'fdc/DiskImageUtils.cc',
    'fdc/DiskManipulator.cc',
    'fdc/DiskName.cc',
    'fdc/DiskPartition.cc',
    'fdc/DriveMultiplexer.cc',
    'fdc/DummyDisk.cc',
    'fdc/EmptyDiskPatch.cc',
    'fdc/MSXFDC.cc',
    'fdc/MSXtar.cc',
    'fdc/MicrosolFDC.cc',
    'fdc/NationalFDC.cc',
    'fdc/NowindCommand.cc',
    'fdc/NowindHost.cc',
    'fdc/NowindInterface.cc',
    'fdc/NowindRomDisk.cc',
    'fdc/PhilipsFDC.cc',
    'fdc/RamDSKDiskImage.cc',
    'fdc/RawTrack.cc',
    'fdc/RealDrive.cc',
    'fdc/SVIFDC.cc',
    'fdc/SanyoFDC.cc',
    'fdc/SectorAccessibleDisk.cc',
    'fdc/SectorBasedDisk.cc',
    'fdc/SpectravideoFDC.cc',
    'fdc/TC8566AF.cc',
    'fdc/ToshibaFDC.cc',
    'fdc/TurboRFDC.cc',
    'fdc/VictorFDC.cc',
    'fdc/WD2793.cc',
    'fdc/WD2793BasedFDC.cc',
    'fdc/XSADiskImage.cc',
    'fdc/YamahaFDC.cc',
    'file/CompressedFileAdapter.cc',
    'file/File.cc',
    'file/FileBase.cc',
    'file/FileContext.cc',
    'file/FileOperations.cc',
    'file/FilePool.cc',
    'file/FilePoolCore.cc',
    'file/Filename.cc',
    'file/GZFileAdapter.cc',
    'file/LocalFile.cc',
    'file/LocalFileReference.cc',
    'file/PreCacheFile.cc',
    'file/ReadDir.cc',
    'file/ZipFileAdapter.cc',
    'file/ZlibInflate.cc',
    'ide/AbstractIDEDevice.cc',
    'ide/BeerIDE.cc',
    'ide/CDImageCLI.cc',
    'ide/DummyIDEDevice.cc',
    'ide/DummySCSIDevice.cc',
    'ide/GoudaSCSI.cc',
    'ide/HD.cc',
    'ide/HDCommand.cc',
    'ide/HDImageCLI.cc',
    'ide/IDECDROM.cc',
    'ide/IDEDeviceFactory.cc',
    'ide/IDEHD.cc',
    'ide/MB89352.cc',
    'ide/MegaSCSI.cc',
    'ide/SCSIHD.cc',
    'ide/SCSILS120.cc',
    'ide/SunriseIDE.cc',
    'ide/WD33C93.cc',
    'input/ArkanoidPad.cc',
    'input/ColecoJoystickIO.cc',
    'input/DummyJoystick.cc',
    'input/EventDelay.cc',
    'input/JoyMega.cc',
    'input/JoyTap.cc',
    'input/Joystick.cc',
    'input/JoystickDevice.cc',
    'input/JoystickPort.cc',
    'input/KeyJoystick.cc',
    'input/Keyboard.cc',
    'input/KeyboardSettings.cc',
    'input/MSXEventDistributor.cc',
    'input/MagicKey.cc',
    'input/Mouse.cc',
    'input/NinjaTap.cc',
    'input/Paddle.cc',
    'input/RecordedCommand.cc',
    'input/SETetrisDongle.cc',
    'input/StateChangeDistributor.cc',
    'input/Touchpad.cc',
    'input/Trackball.cc',
    'input/UnicodeKeymap.cc',
    'memory/AmdFlash.cc',
    'memory/Carnivore2.cc',
    'memory/CheckedRam.cc',
    'memory/ColecoSuperGameModule.cc',
    'memory/EEPROM_93C46.cc',
    'memory/ESE_RAM.cc',
    'memory/ESE_SCC.cc',
    'memory/FraelSwitchableROM.cc',
    'memory/KonamiUltimateCollection.cc',
    'memory/MSXHBI55.cc',
    'memory/MSXMapperIO.cc',
    'memory/MSXMegaRam.cc',
    'memory/MSXMemoryMapper.cc',
    'memory/MSXMemoryMapperBase.cc',
    'memory/MSXMirrorDevice.cc',
    'memory/MSXPac.cc',
    'memory/MSXRam.cc',
    'memory/MSXRom.cc',
    'memory/MSXRomCLI.cc',
    'memory/MegaFlashRomSCCPlus.cc',
    'memory/MegaFlashRomSCCPlusSD.cc',
    'memory/MusicalMemoryMapper.cc',
    'memory/PanasonicMemory.cc',
    'memory/PanasonicRam.cc',
    'memory/ROMHunterMk2.cc',
    'memory/Ram.cc',
    'memory/ReproCartridgeV1.cc',
    'memory/ReproCartridgeV2.cc',
    'memory/Rom.cc',
    'memory/RomArc.cc',
    'memory/RomAscii16_2.cc',
    'memory/RomAscii16kB.cc',
    'memory/RomAscii8_8.cc',
    'memory/RomAscii8kB.cc',
    'memory/RomBlocks.cc',
    'memory/RomColecoMegaCart.cc',
    'memory/RomCrossBlaim.cc',
    'memory/RomDRAM.cc',
    'memory/RomDatabase.cc',
    'memory/RomDooly.cc',
    'memory/RomFSA1FM.cc',
    'memory/RomFactory.cc',
    'memory/RomGameMaster2.cc',
    'memory/RomGeneric16kB.cc',
    'memory/RomGeneric8kB.cc',
    'memory/RomHalnote.cc',
    'memory/RomHarryFox.cc',
    'memory/RomHolyQuran.cc',
    'memory/RomHolyQuran2.cc',
    'memory/RomInfo.cc',
    'memory/RomInfoTopic.cc',
    'memory/RomKonami.cc',
    'memory/RomKonamiKeyboardMaster.cc',
    'memory/RomKonamiSCC.cc',
    'memory/RomMSXDOS2.cc',
    'memory/RomMSXWrite.cc',
    'memory/RomMSXtra.cc',
    'memory/RomMajutsushi.cc',
    'memory/RomManbow2.cc',
    'memory/RomMatraCompilation.cc',
    'memory/RomMatraInk.cc',
    'memory/RomMitsubishiMLTS2.cc',
    'memory/RomMultiRom.cc',
    'memory/RomNational.cc',
    'memory/RomNettouYakyuu.cc',
    'memory/RomPadial16kB.cc',
    'memory/RomPadial8kB.cc',
    'memory/RomPageNN.cc',
    'memory/RomPanasonic.cc',
    'memory/RomPlain.cc',
    'memory/RomPlayBall.cc',
    'memory/RomRType.cc',
    'memory/RomRamFile.cc',
    'memory/RomSuperLodeRunner.cc',
    'memory/RomSuperSwangi.cc',
    'memory/RomSynthesizer.cc',
    'memory/RomZemina126in1.cc',
    'memory/RomZemina80in1.cc',
    'memory/RomZemina90in1.cc',
    'memory/RomZemina25in1.cc',
    'memory/SRAM.cc',
    'memory/SdCard.cc',
    'memory/TrackedRam.cc',
    'security/SocketStreamWrapper.cc',
    'security/SspiNegotiateServer.cc',
    'security/SspiUtils.cc',
    'serial/ClockPin.cc',
    'serial/DummyMidiInDevice.cc',
    'serial/DummyMidiOutDevice.cc',
    'serial/DummyRS232Device.cc',
    'serial/I8251.cc',
    'serial/I8254.cc',
    'serial/JVCMSXMIDI.cc',
    'serial/MC6850.cc',
    'serial/MSXFacMidiInterface.cc',
    'serial/MSXMidi.cc',
    'serial/MSXRS232.cc',
    'serial/MidiInConnector.cc',
    'serial/MidiInCoreMIDI.cc',
    'serial/MidiInDevice.cc',
    'serial/MidiInReader.cc',
    'serial/MidiInWindows.cc',
    'serial/MidiOutConnector.cc',
    'serial/MidiOutCoreMIDI.cc',
    'serial/MidiOutDevice.cc',
    'serial/MidiOutLogger.cc',
    'serial/MidiOutWindows.cc',
    'serial/Midi_w32.cc',
    'serial/MusicModuleMIDI.cc',
    'serial/RS232Connector.cc',
    'serial/RS232Device.cc',
    'serial/RS232Tester.cc',
    'serial/YM2148.cc',
    'serialize.cc',
    'serialize_core.cc',
    'serialize_meta.cc',
    'settings/BooleanSetting.cc',
    'settings/EnumSetting.cc',
    'settings/FilenameSetting.cc',
    'settings/FloatSetting.cc',
    'settings/IntegerSetting.cc',
    'settings/KeyCodeSetting.cc',
    'settings/ProxySetting.cc',
    'settings/ReadOnlySetting.cc',
    'settings/Setting.cc',
    'settings/SettingsManager.cc',
    'settings/StringSetting.cc',
    'settings/UserSettings.cc',
    'settings/VideoSourceSetting.cc',
    'sound/AY8910.cc',
    'sound/AY8910Periphery.cc',
    'sound/AudioInputConnector.cc',
    'sound/AudioInputDevice.cc',
    'sound/BlipBuffer.cc',
    'sound/DACSound16S.cc',
    'sound/DACSound8U.cc',
    'sound/DummyAudioInputDevice.cc',
    'sound/DummyY8950KeyboardDevice.cc',
    'sound/EmuTimer.cc',
    'sound/KeyClick.cc',
    'sound/MSXAudio.cc',
    'sound/MSXFmPac.cc',
    'sound/MSXMixer.cc',
    'sound/MSXMoonSound.cc',
    'sound/MSXMusic.cc',
    'sound/MSXOPL3Cartridge.cc',
    'sound/MSXPSG.cc',
    'sound/MSXSCCPlusCart.cc',
    'sound/MSXTurboRPCM.cc',
    'sound/MSXYamahaSFG.cc',
    'sound/Mixer.cc',
    'sound/NullSoundDriver.cc',
    'sound/ResampleBlip.cc',
    'sound/ResampleHQ.cc',
    'sound/ResampleLQ.cc',
    'sound/ResampleTrivial.cc',
    'sound/ResampledSoundDevice.cc',
    'sound/SCC.cc',
    'sound/SDLSoundDriver.cc',
    'sound/SN76489.cc',
    'sound/SNPSG.cc',
    'sound/SVIPSG.cc',
    'sound/SamplePlayer.cc',
    'sound/SoundDevice.cc',
    'sound/VLM5030.cc',
    'sound/WavAudioInput.cc',
    'sound/WavWriter.cc',
    'sound/Y8950.cc',
    'sound/Y8950Adpcm.cc',
    'sound/Y8950KeyboardConnector.cc',
    'sound/Y8950KeyboardDevice.cc',
    'sound/Y8950Periphery.cc',
    'sound/YM2151.cc',
    'sound/YM2413.cc',
    'sound/YM2413Burczynski.cc',
    'sound/YM2413NukeYKT.cc',
    'sound/YM2413Okazaki.cc',
    'sound/YM2413OriginalNukeYKT.cc',
    'sound/YMF262.cc',
    'sound/YMF278.cc',
    'sound/opll.cc',
    'thread/Thread.cc',
    'thread/Timer.cc',
    'utils/Base64.cc',
    'utils/Date.cc',
    'utils/DeltaBlock.cc',
    'utils/DivModBySame.cc',
    'utils/HexDump.cc',
    'utils/MemoryOps.cc',
    'utils/Poller.cc',
    'utils/SerializeBuffer.cc',
    'utils/StringOp.cc',
    'utils/TigerTree.cc',
    'utils/lz4.cc',
    'utils/rapidsax.cc',
    'utils/sha1.cc',
    'utils/tiger.cc',
    'utils/utf8_checked.cc',
    'utils/win32-arggen.cc',
    'utils/win32-dirent.cc',
    'video/ADVram.cc',
    'video/AviRecorder.cc',
    'video/AviWriter.cc',
    'video/BaseImage.cc',
    'video/BitmapConverter.cc',
    'video/CharacterConverter.cc',
    'video/Deflicker.cc',
    'video/DeinterlacedFrame.cc',
    'video/Display.cc',
    'video/DoubledFrame.cc',
    'video/DummyRenderer.cc',
    'video/DummyVideoSystem.cc',
    'video/FBPostProcessor.cc',
    'video/FrameSource.cc',
    'video/Icon.cc',
    'video/Layer.cc',
    'video/OutputSurface.cc',
    'video/PNG.cc',
    'video/PixelRenderer.cc',
    'video/PostProcessor.cc',
    'video/RawFrame.cc',
    'video/RenderSettings.cc',
    'video/RendererFactory.cc',
    'video/SDLImage.cc',
    'video/SDLOffScreenSurface.cc',
    'video/SDLOutputSurface.cc',
    'video/SDLRasterizer.cc',
    'video/SDLSnow.cc',
    'video/SDLVideoSystem.cc',
    'video/SDLVisibleSurface.cc',
    'video/SDLVisibleSurfaceBase.cc',
    'video/SpriteChecker.cc',
    'video/SuperImposedFrame.cc',
    'video/SuperImposedVideoFrame.cc',
    'video/VDP.cc',
    'video/VDPAccessSlots.cc',
    'video/VDPCmdEngine.cc',
    'video/VDPVRAM.cc',
    'video/VideoLayer.cc',
    'video/VideoSystem.cc',
    'video/VisibleSurface.cc',
    'video/ZMBVEncoder.cc',
    'video/scalers/DirectScalerOutput.cc',
    'video/scalers/HQ2xLiteScaler.cc',
    'video/scalers/HQ2xScaler.cc',
    'video/scalers/HQ3xLiteScaler.cc',
    'video/scalers/HQ3xScaler.cc',
    'video/scalers/MLAAScaler.cc',
    'video/scalers/Multiply32.cc',
    'video/scalers/RGBTriplet3xScaler.cc',
    'video/scalers/SaI2xScaler.cc',
    'video/scalers/SaI3xScaler.cc',
    'video/scalers/Scale2xScaler.cc',
    'video/scalers/Scale3xScaler.cc',
    'video/scalers/Scaler1.cc',
    'video/scalers/Scaler2.cc',
    'video/scalers/Scaler3.cc',
    'video/scalers/ScalerFactory.cc',
    'video/scalers/Scanline.cc',
    'video/scalers/Simple2xScaler.cc',
    'video/scalers/Simple3xScaler.cc',
    'video/scalers/StretchScalerOutput.cc',
    'video/scalers/SuperImposeScalerOutput.cc',
    'video/v9990/V9990.cc',
    'video/v9990/V9990BitmapConverter.cc',
    'video/v9990/V9990CmdEngine.cc',
    'video/v9990/V9990DummyRenderer.cc',
    'video/v9990/V9990PxConverter.cc',
    'video/v9990/V9990PixelRenderer.cc',
    'video/v9990/V9990SDLRasterizer.cc',
    'video/v9990/V9990VRAM.cc',
    'video/v9990/Video9000.cc',
    )

if not get_option('alsamidi').disabled()
    sources += files(
        'serial/MidiSessionALSA.cc',
        )
endif

if not get_option('glrenderer').disabled()
    sources += files(
        'video/GLContext.cc',
        'video/GLImage.cc',
        'video/GLPostProcessor.cc',
        'video/GLSnow.cc',
        'video/GLUtil.cc',
        'video/SDLGLOffScreenSurface.cc',
        'video/SDLGLVisibleSurface.cc',
        'video/scalers/GLDefaultScaler.cc',
        'video/scalers/GLHQLiteScaler.cc',
        'video/scalers/GLHQScaler.cc',
        'video/scalers/GLRGBScaler.cc',
        'video/scalers/GLSaIScaler.cc',
        'video/scalers/GLScaleNxScaler.cc',
        'video/scalers/GLScaler.cc',
        'video/scalers/GLScalerFactory.cc',
        'video/scalers/GLSimpleScaler.cc',
        'video/scalers/GLTVScaler.cc',
        )
endif

if not get_option('laserdisc').disabled()
    sources += files(
        'laserdisc/LaserdiscPlayer.cc',
        'laserdisc/LaserdiscPlayerCLI.cc',
        'laserdisc/OggReader.cc',
        'laserdisc/PioneerLDControl.cc',
        'laserdisc/yuv2rgb.cc',
        'video/ld/LDDummyRenderer.cc',
        'video/ld/LDPixelRenderer.cc',
        'video/ld/LDSDLRasterizer.cc',
        )
endif

main_sources = files(
    'main.cc',
    )

test_sources = files(
    'unittest/AdhocCliCommParser_test.cc',
    'unittest/Base64_test.cc',
    'unittest/CRC16_test.cc',
    'unittest/CircularBuffer_test.cc',
    'unittest/Date_test.cc',
    'unittest/DivMod_test.cc',
    'unittest/FilePoolCore_test.cc',
    'unittest/FixedPoint_test.cc',
    'unittest/HexDump_test.cc',
    'unittest/Keys_test.cc',
    'unittest/Math_test.cc',
    'unittest/MemoryBufferFile.cc',
    'unittest/MemoryBufferFile_test.cc',
    'unittest/ObjectPool_test.cc',
    'unittest/ScopedAssign_test.cc',
    'unittest/SimpleHashSet_test.cc',
    'unittest/StringOp_test.cc',
    'unittest/TclArgParser.cc',
    'unittest/TclObject_test.cc',
    'unittest/TigerTree_test.cc',
    'unittest/WavData_test.cc',
    'unittest/circular_buffer_test.cc',
    'unittest/eeprom.cc',
    'unittest/endian_test.cc',
    'unittest/gl_mat.cc',
    'unittest/gl_transform.cc',
    'unittest/gl_vec.cc',
    'unittest/join_test.cc',
    'unittest/main.cc',
    'unittest/semiregular_test.cc',
    'unittest/sha1.cc',
    'unittest/stl_test.cc',
    'unittest/strCat.cc',
    'unittest/view_test.cc',
    'unittest/xrange_test.cc',
    )

incdirs = include_directories(
    '.',
    'cassette',
    'commands',
    'config',
    'console',
    'cpu',
    'debugger',
    'events',
    'fdc',
    'file',
    'ide',
    'input',
    'laserdisc',
    'memory',
    'resource',
    'security',
    'serial',
    'settings',
    'sound',
    'thread',
    'utils',
    'video',
    'video/ld',
    'video/scalers',
    'video/v9990',
    )
