mirror of https://github.com/AxioDL/boo.git
Merge pull request #21 from lioncash/cmake
CMakeLists: Migrate off variables where applicable
This commit is contained in:
commit
f3585c7660
414
CMakeLists.txt
414
CMakeLists.txt
|
@ -5,40 +5,94 @@ cmake_policy(SET CMP0074 NEW)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
if (NOT MSVC)
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT TARGET logvisor)
|
if (NOT TARGET logvisor)
|
||||||
add_subdirectory(logvisor)
|
add_subdirectory(logvisor)
|
||||||
endif()
|
endif()
|
||||||
|
add_subdirectory(soxr/src)
|
||||||
add_subdirectory(xxhash)
|
add_subdirectory(xxhash)
|
||||||
|
|
||||||
|
add_library(boo
|
||||||
|
lib/audiodev/Common.hpp
|
||||||
|
lib/audiodev/AudioMatrix.hpp
|
||||||
|
lib/audiodev/AudioSubmix.cpp
|
||||||
|
lib/audiodev/AudioSubmix.hpp
|
||||||
|
lib/audiodev/AudioVoice.cpp
|
||||||
|
lib/audiodev/AudioVoice.hpp
|
||||||
|
lib/audiodev/AudioVoiceEngine.cpp
|
||||||
|
lib/audiodev/AudioVoiceEngine.hpp
|
||||||
|
lib/audiodev/LtRtProcessing.cpp
|
||||||
|
lib/audiodev/LtRtProcessing.hpp
|
||||||
|
lib/audiodev/MIDICommon.cpp
|
||||||
|
lib/audiodev/MIDICommon.hpp
|
||||||
|
lib/audiodev/MIDIDecoder.cpp
|
||||||
|
lib/audiodev/MIDIEncoder.cpp
|
||||||
|
lib/audiodev/WAVOut.cpp
|
||||||
|
lib/Common.hpp
|
||||||
|
lib/graphicsdev/Common.cpp
|
||||||
|
lib/graphicsdev/Common.hpp
|
||||||
|
lib/inputdev/DeviceBase.cpp include/boo/inputdev/DeviceBase.hpp
|
||||||
|
lib/inputdev/CafeProPad.cpp include/boo/inputdev/CafeProPad.hpp
|
||||||
|
lib/inputdev/RevolutionPad.cpp include/boo/inputdev/RevolutionPad.hpp
|
||||||
|
lib/inputdev/DolphinSmashAdapter.cpp include/boo/inputdev/DolphinSmashAdapter.hpp
|
||||||
|
lib/inputdev/NintendoPowerA.cpp include/boo/inputdev/NintendoPowerA.hpp
|
||||||
|
lib/inputdev/DualshockPad.cpp include/boo/inputdev/DualshockPad.hpp
|
||||||
|
lib/inputdev/GenericPad.cpp include/boo/inputdev/GenericPad.hpp
|
||||||
|
lib/inputdev/DeviceSignature.cpp include/boo/inputdev/DeviceSignature.hpp
|
||||||
|
lib/inputdev/DeviceFinder.cpp include/boo/inputdev/DeviceFinder.hpp
|
||||||
|
lib/inputdev/HIDParser.cpp include/boo/inputdev/HIDParser.hpp
|
||||||
|
lib/inputdev/IHIDDevice.hpp
|
||||||
|
include/boo/IGraphicsContext.hpp
|
||||||
|
include/boo/audiodev/IAudioSubmix.hpp
|
||||||
|
include/boo/audiodev/IAudioVoice.hpp
|
||||||
|
include/boo/audiodev/IAudioVoiceEngine.hpp
|
||||||
|
include/boo/audiodev/IMIDIPort.hpp
|
||||||
|
include/boo/audiodev/IMIDIReader.hpp
|
||||||
|
include/boo/audiodev/MIDIDecoder.hpp
|
||||||
|
include/boo/audiodev/MIDIEncoder.hpp
|
||||||
|
include/boo/graphicsdev/IGraphicsDataFactory.hpp
|
||||||
|
include/boo/graphicsdev/IGraphicsCommandQueue.hpp
|
||||||
|
include/boo/inputdev/IHIDListener.hpp
|
||||||
|
include/boo/inputdev/XInputPad.hpp
|
||||||
|
include/boo/boo.hpp
|
||||||
|
include/boo/BooObject.hpp
|
||||||
|
include/boo/DeferredWindowEvents.hpp
|
||||||
|
include/boo/IApplication.hpp
|
||||||
|
include/boo/IWindow.hpp
|
||||||
|
include/boo/System.hpp
|
||||||
|
include/boo/ThreadLocalPtr.hpp
|
||||||
|
InputDeviceClasses.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
if (NOT MSVC)
|
||||||
|
target_compile_options(boo PRIVATE -Wno-narrowing)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(BOO_GRAPHICS_DEBUG_GROUPS "Enable Debug Groups for labeling graphics passes within backend API." OFF)
|
option(BOO_GRAPHICS_DEBUG_GROUPS "Enable Debug Groups for labeling graphics passes within backend API." OFF)
|
||||||
if (BOO_GRAPHICS_DEBUG_GROUPS)
|
if (BOO_GRAPHICS_DEBUG_GROUPS)
|
||||||
message(STATUS "Enabling graphics debug groups")
|
message(STATUS "Enabling graphics debug groups")
|
||||||
list(APPEND _BOO_SYS_DEFINES -DBOO_GRAPHICS_DEBUG_GROUPS=1)
|
target_compile_definitions(boo PUBLIC -DBOO_GRAPHICS_DEBUG_GROUPS=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
||||||
find_package(IPP)
|
find_package(IPP)
|
||||||
if (IPP_FOUND)
|
if (IPP_FOUND)
|
||||||
list(APPEND _BOO_SYS_DEFINES -DINTEL_IPP=1)
|
target_compile_definitions(boo PUBLIC -DINTEL_IPP=1)
|
||||||
list(APPEND _BOO_SYS_INCLUDES ${IPP_INCLUDE_DIRS})
|
target_include_directories(boo PUBLIC ${IPP_INCLUDE_DIRS})
|
||||||
list(APPEND _BOO_SYS_LIBS ${IPP_LIBRARIES})
|
target_link_libraries(boo ${IPP_LIBRARIES})
|
||||||
message(STATUS "Building with IPP support")
|
message(STATUS "Building with IPP support")
|
||||||
else()
|
else()
|
||||||
message(WARNING "IPP not found; skipping support")
|
message(WARNING "IPP not found; skipping support")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_subdirectory(soxr/src)
|
target_include_directories(boo PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
set(_EXTRA_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR})
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
)
|
||||||
|
|
||||||
add_subdirectory(lib/graphicsdev/nx)
|
add_subdirectory(lib/graphicsdev/nx)
|
||||||
if(TARGET nx_compiler)
|
if(TARGET nx_compiler)
|
||||||
list(APPEND _BOO_SYS_DEFINES -DHECL_NOUVEAU_NX=1)
|
target_compile_definitions(boo PUBLIC -DHECL_NOUVEAU_NX=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX AND NOT APPLE)
|
if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX AND NOT APPLE)
|
||||||
|
@ -46,97 +100,128 @@ if(NOT GEKKO AND NOT CAFE AND NOT WINDOWS_STORE AND NOT NX AND NOT APPLE)
|
||||||
target_include_directories(glew PUBLIC include/boo/graphicsdev)
|
target_include_directories(glew PUBLIC include/boo/graphicsdev)
|
||||||
target_compile_definitions(glew PUBLIC -DGLEW_NO_GLU=1)
|
target_compile_definitions(glew PUBLIC -DGLEW_NO_GLU=1)
|
||||||
|
|
||||||
list(APPEND PLAT_SRCS lib/graphicsdev/GL.cpp)
|
target_sources(boo PRIVATE lib/graphicsdev/GL.cpp)
|
||||||
list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_GL=1)
|
target_compile_definitions(boo PUBLIC -DBOO_HAS_GL=1)
|
||||||
list(APPEND _BOO_SYS_LIBS glew)
|
target_link_libraries(boo PUBLIC glew)
|
||||||
|
|
||||||
list(APPEND PLAT_HDRS
|
target_sources(boo PRIVATE
|
||||||
include/boo/graphicsdev/GLSLMacros.hpp
|
|
||||||
include/boo/graphicsdev/GL.hpp
|
include/boo/graphicsdev/GL.hpp
|
||||||
|
include/boo/graphicsdev/GLSLMacros.hpp
|
||||||
include/boo/graphicsdev/Vulkan.hpp
|
include/boo/graphicsdev/Vulkan.hpp
|
||||||
include/boo/graphicsdev/VulkanDispatchTable.hpp)
|
include/boo/graphicsdev/VulkanDispatchTable.hpp
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WINDOWS_STORE)
|
if(WINDOWS_STORE)
|
||||||
list(APPEND PLAT_SRCS
|
target_sources(boo PRIVATE
|
||||||
lib/win/ApplicationUWP.cpp
|
lib/audiodev/AudioMatrixSSE.cpp
|
||||||
lib/win/WindowUWP.cpp
|
lib/audiodev/WASAPI.cpp
|
||||||
lib/win/WinCommon.hpp
|
|
||||||
lib/win/UWPCommon.hpp
|
|
||||||
lib/inputdev/HIDListenerUWP.cpp
|
|
||||||
lib/inputdev/HIDDeviceUWP.cpp
|
lib/inputdev/HIDDeviceUWP.cpp
|
||||||
|
lib/inputdev/HIDListenerUWP.cpp
|
||||||
lib/graphicsdev/D3D11.cpp
|
lib/graphicsdev/D3D11.cpp
|
||||||
lib/graphicsdev/D3D12.cpp
|
lib/graphicsdev/D3D12.cpp
|
||||||
lib/audiodev/WASAPI.cpp
|
lib/win/ApplicationUWP.cpp
|
||||||
lib/audiodev/AudioMatrixSSE.cpp)
|
lib/win/UWPCommon.hpp
|
||||||
|
lib/win/WinCommon.hpp
|
||||||
|
lib/win/WindowUWP.cpp
|
||||||
|
|
||||||
list(APPEND PLAT_HDRS
|
|
||||||
include/boo/UWPViewProvider.hpp
|
include/boo/UWPViewProvider.hpp
|
||||||
include/boo/graphicsdev/D3D.hpp)
|
include/boo/graphicsdev/D3D.hpp
|
||||||
|
)
|
||||||
|
|
||||||
list(APPEND _BOO_SYS_DEFINES -DUNICODE -D_UNICODE)
|
target_compile_definitions(boo PUBLIC
|
||||||
|
-DUNICODE
|
||||||
list(APPEND _BOO_SYS_LIBS Winusb opengl32 Setupapi Imm32 Winmm Shlwapi Hid Xinput)
|
-D_UNICODE
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(boo PUBLIC
|
||||||
|
Hid
|
||||||
|
Imm32
|
||||||
|
opengl32
|
||||||
|
Setupapi
|
||||||
|
Shlwapi
|
||||||
|
Winmm
|
||||||
|
Winusb
|
||||||
|
Xinput
|
||||||
|
)
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
unset(VULKAN_SDK_DIRS CACHE)
|
unset(VULKAN_SDK_DIRS CACHE)
|
||||||
get_filename_component(VULKAN_SDK_DIRS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\LunarG\\VulkanSDK;VK_SDK_PATHs]" ABSOLUTE CACHE)
|
get_filename_component(VULKAN_SDK_DIRS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\LunarG\\VulkanSDK;VK_SDK_PATHs]" ABSOLUTE CACHE)
|
||||||
if (NOT ${VULKAN_SDK_DIRS} STREQUAL "/registry")
|
if (NOT ${VULKAN_SDK_DIRS} STREQUAL "/registry")
|
||||||
message(STATUS "Enabling Vulkan support")
|
message(STATUS "Enabling Vulkan support")
|
||||||
list(GET VULKAN_SDK_DIRS 0 VULKAN_SDK_DIR)
|
list(GET VULKAN_SDK_DIRS 0 VULKAN_SDK_DIR)
|
||||||
list(APPEND _EXTRA_INCLUDES ${VULKAN_SDK_DIR}/Include)
|
target_include_directories(boo PRIVATE "${VULKAN_SDK_DIR}/Include")
|
||||||
list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_VULKAN=1 -DVK_USE_PLATFORM_WIN32_KHR=1)
|
target_compile_definitions(boo PUBLIC
|
||||||
list(APPEND _BOO_SYS_INCLUDES "${VULKAN_SDK_DIR}/Include")
|
-DBOO_HAS_VULKAN=1
|
||||||
list(APPEND PLAT_SRCS lib/graphicsdev/Vulkan.cpp
|
-DVK_USE_PLATFORM_WIN32_KHR=1
|
||||||
lib/graphicsdev/VulkanDispatchTable.cpp)
|
)
|
||||||
|
target_sources(boo PRIVATE
|
||||||
|
lib/graphicsdev/Vulkan.cpp
|
||||||
|
lib/graphicsdev/VulkanDispatchTable.cpp
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_file(TE_VIRTUAL_MIDI_H teVirtualMIDI.h PATHS
|
find_file(TE_VIRTUAL_MIDI_H teVirtualMIDI.h
|
||||||
"$ENV{PROGRAMFILES\(X86\)}/Tobias Erichsen/teVirtualMIDISDK/C-Binding")
|
PATHS
|
||||||
|
"$ENV{PROGRAMFILES\(X86\)}/Tobias Erichsen/teVirtualMIDISDK/C-Binding"
|
||||||
|
)
|
||||||
if (NO AND TE_VIRTUAL_MIDI_H)
|
if (NO AND TE_VIRTUAL_MIDI_H)
|
||||||
message(STATUS "Enabling teVirtualMIDI")
|
message(STATUS "Enabling teVirtualMIDI")
|
||||||
get_filename_component(TE_VIRTUAL_MIDI_DIR ${TE_VIRTUAL_MIDI_H} DIRECTORY)
|
get_filename_component(TE_VIRTUAL_MIDI_DIR ${TE_VIRTUAL_MIDI_H} DIRECTORY)
|
||||||
list(APPEND _EXTRA_INCLUDES ${TE_VIRTUAL_MIDI_DIR})
|
target_include_directories(boo PRIVATE ${TE_VIRTUAL_MIDI_DIR})
|
||||||
add_definitions("-DTE_VIRTUAL_MIDI=1")
|
add_definitions("-DTE_VIRTUAL_MIDI=1")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND PLAT_SRCS
|
target_sources(boo PRIVATE
|
||||||
|
lib/audiodev/AudioMatrixSSE.cpp
|
||||||
|
lib/audiodev/WASAPI.cpp
|
||||||
|
lib/graphicsdev/D3D11.cpp
|
||||||
|
lib/inputdev/HIDListenerWinUSB.cpp
|
||||||
|
lib/inputdev/HIDDeviceWinUSB.cpp
|
||||||
lib/win/ApplicationWin32.cpp
|
lib/win/ApplicationWin32.cpp
|
||||||
lib/win/WindowWin32.cpp
|
lib/win/WindowWin32.cpp
|
||||||
lib/win/WinCommon.hpp
|
lib/win/WinCommon.hpp
|
||||||
lib/win/Win32Common.hpp
|
lib/win/Win32Common.hpp
|
||||||
lib/inputdev/HIDListenerWinUSB.cpp
|
|
||||||
lib/inputdev/HIDDeviceWinUSB.cpp
|
|
||||||
lib/graphicsdev/D3D11.cpp
|
|
||||||
lib/audiodev/WASAPI.cpp
|
|
||||||
lib/audiodev/AudioMatrixSSE.cpp)
|
|
||||||
|
|
||||||
list(APPEND PLAT_HDRS
|
include/boo/graphicsdev/D3D.hpp
|
||||||
include/boo/graphicsdev/D3D.hpp)
|
)
|
||||||
|
|
||||||
list(APPEND _BOO_SYS_DEFINES -DUNICODE -D_UNICODE)
|
target_compile_definitions(boo PUBLIC
|
||||||
|
-DUNICODE
|
||||||
list(APPEND _BOO_SYS_LIBS Winusb opengl32 Setupapi Imm32 Winmm Shlwapi Hid Xinput)
|
-D_UNICODE
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(boo PUBLIC
|
||||||
|
Hid
|
||||||
|
Imm32
|
||||||
|
Setupapi
|
||||||
|
Shlwapi
|
||||||
|
Winmm
|
||||||
|
Winusb opengl32
|
||||||
|
Xinput
|
||||||
|
)
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
list(APPEND PLAT_SRCS
|
target_sources(boo PRIVATE
|
||||||
|
lib/audiodev/AQS.cpp
|
||||||
|
lib/audiodev/AudioMatrixSSE.cpp
|
||||||
|
lib/inputdev/HIDListenerIOKit.cpp
|
||||||
|
lib/inputdev/HIDDeviceIOKit.cpp
|
||||||
lib/mac/ApplicationCocoa.mm
|
lib/mac/ApplicationCocoa.mm
|
||||||
lib/mac/WindowCocoa.mm
|
lib/mac/WindowCocoa.mm
|
||||||
lib/mac/CocoaCommon.hpp
|
lib/mac/CocoaCommon.hpp
|
||||||
lib/inputdev/HIDListenerIOKit.cpp
|
|
||||||
lib/inputdev/HIDDeviceIOKit.cpp
|
|
||||||
lib/graphicsdev/Metal.mm
|
lib/graphicsdev/Metal.mm
|
||||||
lib/audiodev/AQS.cpp
|
|
||||||
lib/audiodev/AudioMatrixSSE.cpp)
|
lib/CFPointer.hpp
|
||||||
set_source_files_properties(lib/mac/ApplicationCocoa.mm
|
lib/inputdev/IOKitPointer.hpp
|
||||||
|
include/boo/graphicsdev/Metal.hpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set_source_files_properties(
|
||||||
|
lib/mac/ApplicationCocoa.mm
|
||||||
lib/mac/WindowCocoa.mm
|
lib/mac/WindowCocoa.mm
|
||||||
lib/graphicsdev/Metal.mm
|
lib/graphicsdev/Metal.mm
|
||||||
PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
PROPERTIES COMPILE_FLAGS -fobjc-arc
|
||||||
|
)
|
||||||
list(APPEND PLAT_HDRS
|
|
||||||
lib/CFPointer.hpp
|
|
||||||
include/boo/graphicsdev/Metal.hpp
|
|
||||||
lib/inputdev/IOKitPointer.hpp)
|
|
||||||
|
|
||||||
find_library(APPKIT_LIBRARY AppKit)
|
find_library(APPKIT_LIBRARY AppKit)
|
||||||
find_library(IOKIT_LIBRARY IOKit)
|
find_library(IOKIT_LIBRARY IOKit)
|
||||||
|
@ -144,7 +229,7 @@ elseif(APPLE)
|
||||||
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET OR CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.11)
|
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET OR CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER 10.11)
|
||||||
set(BOO_HAS_METAL ON CACHE BOOL "Metal is available in this OS X version" FORCE)
|
set(BOO_HAS_METAL ON CACHE BOOL "Metal is available in this OS X version" FORCE)
|
||||||
find_library(METAL_LIBRARY Metal)
|
find_library(METAL_LIBRARY Metal)
|
||||||
list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_METAL=1)
|
target_compile_definitions(boo PUBLIC -DBOO_HAS_METAL=1)
|
||||||
else()
|
else()
|
||||||
set(METAL_LIBRARY "")
|
set(METAL_LIBRARY "")
|
||||||
endif()
|
endif()
|
||||||
|
@ -153,31 +238,39 @@ elseif(APPLE)
|
||||||
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
find_library(AUDIOTOOLBOX_LIBRARY AudioToolbox)
|
||||||
find_library(COREAUDIO_LIBRARY CoreAudio)
|
find_library(COREAUDIO_LIBRARY CoreAudio)
|
||||||
find_library(COREMIDI_LIBRARY CoreMIDI)
|
find_library(COREMIDI_LIBRARY CoreMIDI)
|
||||||
list(APPEND _BOO_SYS_LIBS ${APPKIT_LIBRARY} ${IOKIT_LIBRARY} ${METAL_LIBRARY}
|
|
||||||
${QUARTZCORE_LIBRARY} ${COREVIDEO_LIBRARY} ${AUDIOTOOLBOX_LIBRARY}
|
|
||||||
${COREAUDIO_LIBRARY} ${COREMIDI_LIBRARY})
|
|
||||||
|
|
||||||
|
target_link_libraries(boo PUBLIC
|
||||||
|
${APPKIT_LIBRARY}
|
||||||
|
${AUDIOTOOLBOX_LIBRARY}
|
||||||
|
${COREAUDIO_LIBRARY}
|
||||||
|
${COREMIDI_LIBRARY}
|
||||||
|
${COREVIDEO_LIBRARY}
|
||||||
|
${IOKIT_LIBRARY}
|
||||||
|
${METAL_LIBRARY}
|
||||||
|
${QUARTZCORE_LIBRARY}
|
||||||
|
)
|
||||||
elseif(NX)
|
elseif(NX)
|
||||||
list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_NX=1)
|
target_compile_definitions(boo PUBLIC -DBOO_HAS_NX=1)
|
||||||
list(APPEND PLAT_SRCS
|
target_sources(boo PRIVATE
|
||||||
lib/nx/ApplicationNX.cpp
|
lib/nx/ApplicationNX.cpp
|
||||||
lib/nx/WindowNX.cpp
|
lib/nx/WindowNX.cpp
|
||||||
lib/audiodev/AudioMatrix.cpp
|
lib/audiodev/AudioMatrix.cpp
|
||||||
lib/inputdev/HIDListenerNX.cpp
|
lib/inputdev/HIDListenerNX.cpp
|
||||||
lib/inputdev/HIDDeviceNX.cpp)
|
lib/inputdev/HIDDeviceNX.cpp
|
||||||
list(APPEND _BOO_SYS_LIBS nx_runtime)
|
)
|
||||||
|
target_link_libraries(boo PUBLIC nx_runtime)
|
||||||
else(NOT GEKKO)
|
else(NOT GEKKO)
|
||||||
list(APPEND PLAT_SRCS
|
target_sources(boo PRIVATE
|
||||||
lib/x11/XlibCommon.hpp
|
lib/audiodev/LinuxMidi.hpp
|
||||||
lib/x11/ApplicationUnix.cpp
|
|
||||||
lib/x11/ApplicationXlib.hpp
|
|
||||||
lib/x11/ApplicationWayland.hpp
|
|
||||||
lib/x11/WindowXlib.cpp
|
|
||||||
lib/x11/WindowWayland.cpp
|
|
||||||
lib/graphicsdev/GL.cpp
|
lib/graphicsdev/GL.cpp
|
||||||
lib/graphicsdev/GLX.cpp
|
lib/graphicsdev/GLX.cpp
|
||||||
lib/audiodev/LinuxMidi.hpp)
|
lib/x11/XlibCommon.hpp
|
||||||
|
lib/x11/ApplicationUnix.cpp
|
||||||
|
lib/x11/ApplicationWayland.hpp
|
||||||
|
lib/x11/ApplicationXlib.hpp
|
||||||
|
lib/x11/WindowWayland.cpp
|
||||||
|
lib/x11/WindowXlib.cpp
|
||||||
|
)
|
||||||
|
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
if(PKG_CONFIG_FOUND)
|
if(PKG_CONFIG_FOUND)
|
||||||
|
@ -187,73 +280,114 @@ else(NOT GEKKO)
|
||||||
find_path(DBUS_INCLUDE_DIR
|
find_path(DBUS_INCLUDE_DIR
|
||||||
NAMES
|
NAMES
|
||||||
dbus/dbus.h
|
dbus/dbus.h
|
||||||
|
|
||||||
HINTS
|
HINTS
|
||||||
${dbus_pkg_INCLUDE_DIRS}
|
${dbus_pkg_INCLUDE_DIRS}
|
||||||
|
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES
|
||||||
include/
|
include/
|
||||||
include/dbus-1.0/
|
include/dbus-1.0/
|
||||||
dbus-1.0/)
|
dbus-1.0/
|
||||||
|
)
|
||||||
|
|
||||||
find_path(DBUS_ARCH_INCLUDE_DIR
|
find_path(DBUS_ARCH_INCLUDE_DIR
|
||||||
NAMES
|
NAMES
|
||||||
dbus/dbus-arch-deps.h
|
dbus/dbus-arch-deps.h
|
||||||
|
|
||||||
HINTS
|
HINTS
|
||||||
${dbus_pkg_INCLUDE_DIRS}
|
${dbus_pkg_INCLUDE_DIRS}
|
||||||
|
|
||||||
PATHS
|
PATHS
|
||||||
# TODO use CMAKE_SYSTEM_PROCESSOR or similar?
|
# TODO use CMAKE_SYSTEM_PROCESSOR or similar?
|
||||||
/usr/lib/dbus-1.0/include
|
/usr/lib/dbus-1.0/include
|
||||||
/usr/local/lib/dbus-1.0/include
|
/usr/local/lib/dbus-1.0/include
|
||||||
/usr/lib/x86_64-linux-gnu/dbus-1.0/include/
|
/usr/lib/x86_64-linux-gnu/dbus-1.0/include/
|
||||||
|
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES
|
||||||
dbus-1.0/include/)
|
dbus-1.0/include/
|
||||||
|
)
|
||||||
|
|
||||||
find_library(DBUS_LIBRARY
|
find_library(DBUS_LIBRARY
|
||||||
NAMES
|
NAMES
|
||||||
dbus dbus-1
|
dbus
|
||||||
|
dbus-1
|
||||||
|
|
||||||
HINTS
|
HINTS
|
||||||
${dbus_pkg_LIBRARY_DIRS}
|
${dbus_pkg_LIBRARY_DIRS}
|
||||||
|
|
||||||
PATH_SUFFIXES
|
PATH_SUFFIXES
|
||||||
lib
|
lib
|
||||||
lib32
|
lib32
|
||||||
lib64)
|
lib64
|
||||||
|
)
|
||||||
|
|
||||||
find_path(PULSEAUDIO_INCLUDE_DIR
|
find_path(PULSEAUDIO_INCLUDE_DIR
|
||||||
NAMES pulse/pulseaudio.h)
|
NAMES pulse/pulseaudio.h
|
||||||
|
)
|
||||||
if(PULSEAUDIO_INCLUDE_DIR-NOTFOUND)
|
if(PULSEAUDIO_INCLUDE_DIR-NOTFOUND)
|
||||||
message(FATAL_ERROR "Unix build of boo requires pulseaudio")
|
message(FATAL_ERROR "Unix build of boo requires pulseaudio")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND PLAT_SRCS lib/audiodev/PulseAudio.cpp)
|
target_sources(boo PRIVATE lib/audiodev/PulseAudio.cpp)
|
||||||
list(APPEND _BOO_SYS_LIBS pulse)
|
target_link_libraries(boo PUBLIC pulse)
|
||||||
|
|
||||||
if(DBUS_INCLUDE_DIR-NOTFOUND)
|
if(DBUS_INCLUDE_DIR-NOTFOUND)
|
||||||
message(FATAL_ERROR "Unix build of boo requires dbus")
|
message(FATAL_ERROR "Unix build of boo requires dbus")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND _EXTRA_INCLUDES ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
|
target_include_directories(boo PRIVATE
|
||||||
list(APPEND _BOO_SYS_LIBS X11 Xi Xrandr GL asound ${DBUS_LIBRARY} pthread)
|
${DBUS_ARCH_INCLUDE_DIR}
|
||||||
|
${DBUS_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
target_link_libraries(boo
|
||||||
|
PUBLIC
|
||||||
|
asound
|
||||||
|
${DBUS_LIBRARY}
|
||||||
|
GL
|
||||||
|
pthread
|
||||||
|
X11
|
||||||
|
Xi
|
||||||
|
Xrandr
|
||||||
|
)
|
||||||
|
|
||||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||||
find_path(VULKAN_INCLUDE_DIR
|
find_path(VULKAN_INCLUDE_DIR
|
||||||
NAMES vulkan/vulkan.h)
|
NAMES vulkan/vulkan.h
|
||||||
|
)
|
||||||
if(VULKAN_INCLUDE_DIR)
|
if(VULKAN_INCLUDE_DIR)
|
||||||
message(STATUS "Enabling Vulkan support")
|
message(STATUS "Enabling Vulkan support")
|
||||||
list(APPEND PLAT_SRCS
|
target_sources(boo PRIVATE
|
||||||
lib/graphicsdev/Vulkan.cpp
|
lib/graphicsdev/Vulkan.cpp
|
||||||
lib/graphicsdev/VulkanDispatchTable.cpp)
|
lib/graphicsdev/VulkanDispatchTable.cpp
|
||||||
list(APPEND _BOO_SYS_DEFINES -DBOO_HAS_VULKAN=1 -DVK_USE_PLATFORM_XCB_KHR=1)
|
)
|
||||||
|
target_compile_definitions(boo
|
||||||
|
PUBLIC
|
||||||
|
-DBOO_HAS_VULKAN=1
|
||||||
|
-DVK_USE_PLATFORM_XCB_KHR=1
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
list(APPEND PLAT_SRCS
|
target_sources(boo PRIVATE
|
||||||
lib/inputdev/HIDListenerUdev.cpp
|
lib/audiodev/AudioMatrixSSE.cpp
|
||||||
lib/inputdev/HIDDeviceUdev.cpp
|
lib/inputdev/HIDDeviceUdev.cpp
|
||||||
lib/audiodev/AudioMatrixSSE.cpp)
|
lib/inputdev/HIDListenerUdev.cpp
|
||||||
list(APPEND _BOO_SYS_LIBS xcb X11-xcb dl udev)
|
)
|
||||||
|
target_link_libraries(boo
|
||||||
|
PUBLIC
|
||||||
|
dl
|
||||||
|
xcb
|
||||||
|
X11-xcb
|
||||||
|
udev
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
list(APPEND PLAT_SRCS
|
target_sources(boo PRIVATE
|
||||||
lib/inputdev/HIDListenerBSD.cpp
|
lib/audiodev/AudioMatrixSSE.cpp
|
||||||
lib/inputdev/HIDDeviceBSD.cpp
|
lib/inputdev/HIDDeviceBSD.cpp
|
||||||
lib/audiodev/AudioMatrixSSE.cpp)
|
lib/inputdev/HIDListenerBSD.cpp
|
||||||
list(APPEND _BOO_SYS_LIBS execinfo)
|
)
|
||||||
|
target_link_libraries(boo
|
||||||
|
PUBLIC
|
||||||
|
execinfo
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
@ -284,67 +418,29 @@ if(NOT NX)
|
||||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/glslang
|
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/glslang
|
||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND _BOO_SYS_LIBS glslang soxr xxhash OSDependent OGLCompiler SPIRV glslang-default-resource-limits)
|
target_link_libraries(boo
|
||||||
|
PUBLIC
|
||||||
|
glslang
|
||||||
|
glslang-default-resource-limits
|
||||||
|
OGLCompiler
|
||||||
|
OSDependent
|
||||||
|
soxr
|
||||||
|
SPIRV
|
||||||
|
xxhash
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND _EXTRA_INCLUDES glslang soxr/src)
|
target_link_libraries(boo PUBLIC logvisor)
|
||||||
|
target_include_directories(boo
|
||||||
|
PUBLIC
|
||||||
|
include
|
||||||
|
|
||||||
|
PRIVATE
|
||||||
|
glslang
|
||||||
|
soxr/src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
add_library(boo
|
|
||||||
lib/inputdev/DeviceBase.cpp include/boo/inputdev/DeviceBase.hpp
|
|
||||||
lib/inputdev/CafeProPad.cpp include/boo/inputdev/CafeProPad.hpp
|
|
||||||
lib/inputdev/RevolutionPad.cpp include/boo/inputdev/RevolutionPad.hpp
|
|
||||||
lib/inputdev/DolphinSmashAdapter.cpp include/boo/inputdev/DolphinSmashAdapter.hpp
|
|
||||||
lib/inputdev/NintendoPowerA.cpp include/boo/inputdev/NintendoPowerA.hpp
|
|
||||||
lib/inputdev/DualshockPad.cpp include/boo/inputdev/DualshockPad.hpp
|
|
||||||
include/boo/inputdev/XInputPad.hpp
|
|
||||||
lib/inputdev/GenericPad.cpp include/boo/inputdev/GenericPad.hpp
|
|
||||||
lib/inputdev/DeviceSignature.cpp include/boo/inputdev/DeviceSignature.hpp
|
|
||||||
lib/inputdev/DeviceFinder.cpp include/boo/inputdev/DeviceFinder.hpp
|
|
||||||
lib/inputdev/HIDParser.cpp include/boo/inputdev/HIDParser.hpp
|
|
||||||
lib/inputdev/IHIDDevice.hpp
|
|
||||||
lib/audiodev/Common.hpp
|
|
||||||
lib/audiodev/WAVOut.cpp
|
|
||||||
lib/audiodev/AudioMatrix.hpp
|
|
||||||
lib/audiodev/AudioVoiceEngine.hpp
|
|
||||||
lib/audiodev/AudioVoiceEngine.cpp
|
|
||||||
lib/audiodev/AudioVoice.hpp
|
|
||||||
lib/audiodev/AudioVoice.cpp
|
|
||||||
lib/audiodev/AudioSubmix.hpp
|
|
||||||
lib/audiodev/AudioSubmix.cpp
|
|
||||||
lib/audiodev/LtRtProcessing.hpp
|
|
||||||
lib/audiodev/LtRtProcessing.cpp
|
|
||||||
lib/audiodev/MIDIEncoder.cpp
|
|
||||||
lib/audiodev/MIDIDecoder.cpp
|
|
||||||
lib/audiodev/MIDICommon.hpp
|
|
||||||
lib/audiodev/MIDICommon.cpp
|
|
||||||
lib/Common.hpp
|
|
||||||
include/boo/inputdev/IHIDListener.hpp
|
|
||||||
include/boo/IGraphicsContext.hpp
|
|
||||||
include/boo/graphicsdev/IGraphicsDataFactory.hpp
|
|
||||||
include/boo/graphicsdev/IGraphicsCommandQueue.hpp
|
|
||||||
lib/graphicsdev/Common.hpp
|
|
||||||
lib/graphicsdev/Common.cpp
|
|
||||||
include/boo/audiodev/IAudioSubmix.hpp
|
|
||||||
include/boo/audiodev/IAudioVoice.hpp
|
|
||||||
include/boo/audiodev/IMIDIPort.hpp
|
|
||||||
include/boo/audiodev/IMIDIReader.hpp
|
|
||||||
include/boo/audiodev/MIDIEncoder.hpp
|
|
||||||
include/boo/audiodev/MIDIDecoder.hpp
|
|
||||||
include/boo/audiodev/IAudioVoiceEngine.hpp
|
|
||||||
include/boo/IWindow.hpp
|
|
||||||
include/boo/IApplication.hpp
|
|
||||||
include/boo/ThreadLocalPtr.hpp
|
|
||||||
include/boo/DeferredWindowEvents.hpp
|
|
||||||
include/boo/System.hpp
|
|
||||||
include/boo/BooObject.hpp
|
|
||||||
include/boo/boo.hpp
|
|
||||||
InputDeviceClasses.cpp
|
|
||||||
${PLAT_SRCS}
|
|
||||||
${PLAT_HDRS})
|
|
||||||
target_link_libraries(boo PUBLIC ${_BOO_SYS_LIBS} logvisor)
|
|
||||||
target_compile_definitions(boo PUBLIC ${_BOO_SYS_DEFINES})
|
|
||||||
target_include_directories(boo PUBLIC include ${_BOO_SYS_INCLUDES}
|
|
||||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${_EXTRA_INCLUDES})
|
|
||||||
if(COMMAND add_sanitizers)
|
if(COMMAND add_sanitizers)
|
||||||
add_sanitizers(boo)
|
add_sanitizers(boo)
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue