mirror of https://github.com/AxioDL/metaforce.git
Use binary atdna, universal macOS fixes, more
This commit is contained in:
parent
4e38cf3574
commit
7d7db261a2
|
@ -34,10 +34,9 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install build-essential curl git cmake ninja-build llvm-dev libclang-dev clang lld \
|
||||
sudo apt-get -y install curl git cmake ninja-build clang lld qt5-default libcurl4-openssl-dev \
|
||||
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
|
||||
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3 qt5-default \
|
||||
libcurl4-openssl-dev
|
||||
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev python3 python-is-python3
|
||||
# free up disk space
|
||||
# https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
|
||||
echo Before
|
||||
|
@ -50,21 +49,23 @@ jobs:
|
|||
echo After
|
||||
df -h .
|
||||
|
||||
- name: Create build directory
|
||||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
cmake -B build . -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install" \
|
||||
-DCMAKE_C_COMPILER=${{matrix.cc}} -DCMAKE_CXX_COMPILER=${{matrix.cxx}}
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: cmake --build .
|
||||
run: cmake --build build --config RelWithDebInfo --target install
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: metaforce-${{env.METAFORCE_VERSION}}-linux-${{matrix.cc}}-x86_64
|
||||
path: install
|
||||
|
||||
build-macos:
|
||||
name: Build macOS (AppleClang x86_64)
|
||||
name: Build macOS (AppleClang universal)
|
||||
runs-on: macos-10.15
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
@ -75,29 +76,34 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
brew update
|
||||
brew install ninja qt@5 graphicsmagick imagemagick
|
||||
brew link qt@5
|
||||
brew install ninja graphicsmagick imagemagick
|
||||
yarn global add create-dmg
|
||||
|
||||
- name: Create build directory
|
||||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
# universal qt5 from macports
|
||||
curl -LSfs https://axiodl.com/files/qt5-5.15.2.mkpkg -o /tmp/qt5-5.15.2.mkpkg
|
||||
sudo installer -pkg /tmp/qt5-5.15.2.mkpkg -target /
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
export PATH="/usr/local/opt/qt@5/bin:$PATH" # FIXME remove
|
||||
cmake $GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
cmake -B build . -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install" \
|
||||
-DQt5Widgets_DIR=/opt/local/libexec/qt5/lib/cmake/Qt5Widgets \
|
||||
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
|
||||
-DPNG_DIR=/opt/local/lib
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: cmake --build .
|
||||
run: cmake --build build --config RelWithDebInfo --target install
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: metaforce-${{env.METAFORCE_VERSION}}-macos-appleclang-x86_64
|
||||
path: install
|
||||
|
||||
build-windows-msvc:
|
||||
name: Build Windows (MSVC x86_64)
|
||||
if: 'false' # disabled due to memory constraints
|
||||
runs-on: windows-2019
|
||||
env:
|
||||
LLVM_VERSION: 10.0.1
|
||||
Qt_VERSION: 5.15.2
|
||||
IPP_VERSION: 2021.2.0.210
|
||||
steps:
|
||||
|
@ -106,14 +112,6 @@ jobs:
|
|||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Install LLVM
|
||||
run: |
|
||||
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
||||
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
|
||||
New-Item -Path "$TempDir" -ItemType Directory -ea 0
|
||||
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
|
||||
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
|
||||
|
||||
- name: Install vcpkg Qt
|
||||
run: |
|
||||
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
||||
|
@ -132,24 +130,27 @@ jobs:
|
|||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
|
||||
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
||||
cmake -B build . -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
||||
-DCMAKE_INSTALL_PREFIX:PATH="$env:GITHUB_WORKSPACE\install" `
|
||||
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_CXX_FLAGS= -DCMAKE_C_FLAGS= `
|
||||
-DLLVM_ROOT_DIR="$workspace/LLVM"
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: cmake --build .
|
||||
run: cmake --build build --config RelWithDebInfo --target install
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: metaforce-${{env.METAFORCE_VERSION}}-win32-msvc-x86_64
|
||||
path: install
|
||||
|
||||
build-windows-clang:
|
||||
name: Build Windows (Clang x86_64)
|
||||
runs-on: windows-2019
|
||||
env:
|
||||
LLVM_VERSION: 10.0.1
|
||||
Qt_VERSION: 5.15.2
|
||||
IPP_VERSION: 2021.2.0.210
|
||||
steps:
|
||||
|
@ -158,14 +159,6 @@ jobs:
|
|||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Install LLVM
|
||||
run: |
|
||||
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
||||
$Filename = "LLVM-$env:LLVM_VERSION-win64.exe"
|
||||
New-Item -Path "$TempDir" -ItemType Directory -ea 0
|
||||
(New-Object Net.WebClient).DownloadFile("https://axiodl.com/files/$Filename", "$TempDir\$Filename")
|
||||
Start-Process "$TempDir\$Filename" -ArgumentList "/S /D=$env:RUNNER_WORKSPACE\LLVM" -Wait
|
||||
|
||||
- name: Install vcpkg Qt
|
||||
run: |
|
||||
$TempDir = "$env:RUNNER_WORKSPACE\temp"
|
||||
|
@ -180,22 +173,24 @@ jobs:
|
|||
- name: Enable Visual Studio environment
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Create build directory
|
||||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
|
||||
- name: Configure CMake
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
$workspace = $env:RUNNER_WORKSPACE -replace '\\', '/'
|
||||
cmake $env:GITHUB_WORKSPACE -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
||||
cmake -B build . -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo `
|
||||
-DCMAKE_INSTALL_PREFIX:PATH="$env:GITHUB_WORKSPACE/install" `
|
||||
-DCMAKE_TOOLCHAIN_FILE="$workspace/vcpkg-qt-$env:Qt_VERSION/scripts/buildsystems/vcpkg.cmake" `
|
||||
-DVCPKG_TARGET_TRIPLET=x64-windows-static `
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
|
||||
-DCMAKE_C_COMPILER=clang-cl `
|
||||
-DCMAKE_CXX_COMPILER=clang-cl `
|
||||
-DCMAKE_LINKER=lld-link `
|
||||
-DLLVM_ROOT_DIR="$workspace/LLVM"
|
||||
-DCMAKE_LINKER=lld-link
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: cmake --build .
|
||||
run: cmake --build build --config RelWithDebInfo --target install
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: metaforce-${{env.METAFORCE_VERSION}}-win32-clang-x86_64
|
||||
path: install
|
||||
|
|
154
CMakeLists.txt
154
CMakeLists.txt
|
@ -65,10 +65,16 @@ endif()
|
|||
message(STATUS "Metaforce version set to ${METAFORCE_WC_DESCRIBE}")
|
||||
project(metaforce LANGUAGES C CXX ASM VERSION ${METAFORCE_VERSION_STRING})
|
||||
|
||||
if (APPLE)
|
||||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ATHENA_ARCH)
|
||||
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" ATHENA_HOST_ARCH)
|
||||
set(ATHENA_EXTENSION "tar.gz")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
set(PLATFORM_NAME macos)
|
||||
elseif (WIN32)
|
||||
set(ATHENA_ARCH universal)
|
||||
set(ATHENA_HOST_ARCH universal)
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
set(PLATFORM_NAME win32)
|
||||
set(ATHENA_EXTENSION ".7z")
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(PLATFORM_NAME linux)
|
||||
endif ()
|
||||
|
@ -335,11 +341,47 @@ if(NOT GEKKO AND NOT NX)
|
|||
if (NOT CMAKE_INSTALL_LIBDIR)
|
||||
set(CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/fake-prefix)
|
||||
endif()
|
||||
add_subdirectory(extern/discord-rpc/src)
|
||||
add_subdirectory(extern/discord-rpc/src EXCLUDE_FROM_ALL)
|
||||
target_include_directories(discord-rpc PRIVATE extern/rapidjson/include PUBLIC extern/discord-rpc/include)
|
||||
if (APPLE)
|
||||
# remove their nasty hack
|
||||
get_target_property(DISCORD_LINK_LIBRARIES discord-rpc INTERFACE_LINK_LIBRARIES)
|
||||
list(REMOVE_ITEM DISCORD_LINK_LIBRARIES "-framework AppKit, -mmacosx-version-min=10.10")
|
||||
set_target_properties(discord-rpc PROPERTIES INTERFACE_LINK_LIBRARIES "${DISCORD_LINK_LIBRARIES}")
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
add_subdirectory(extern/nod)
|
||||
if (APPLE)
|
||||
# use toolchain zlib
|
||||
find_package(ZLIB REQUIRED)
|
||||
set(ZLIB_LIBRARIES ZLIB::ZLIB)
|
||||
endif()
|
||||
|
||||
if (NOT BUILD_ATDNA)
|
||||
set(ATHENA_BASE_URL "https://github.com/libAthena/athena/releases/download/latest")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(athena-host
|
||||
URL "${ATHENA_BASE_URL}/athena-${PLATFORM_NAME}-${ATHENA_HOST_ARCH}.tar.gz")
|
||||
message(STATUS "Fetching atdna host binary")
|
||||
FetchContent_Populate(athena-host)
|
||||
include(${athena-host_SOURCE_DIR}/lib/cmake/atdna/atdnaConfig.cmake)
|
||||
endif ()
|
||||
|
||||
if (BUILD_ATHENA OR BUILD_ATDNA)
|
||||
add_subdirectory(extern/athena EXCLUDE_FROM_ALL)
|
||||
else()
|
||||
if (ATHENA_ARCH STREQUAL ATHENA_HOST_ARCH)
|
||||
set(athena_SOURCE_DIR "${athena-host_SOURCE_DIR}")
|
||||
else()
|
||||
FetchContent_Declare(athena
|
||||
URL "${ATHENA_BASE_URL}/athena-${PLATFORM_NAME}-${ATHENA_ARCH}.tar.gz")
|
||||
FetchContent_Populate(athena)
|
||||
endif()
|
||||
include(${athena_SOURCE_DIR}/lib/cmake/athena/AthenaConfig.cmake)
|
||||
include(${athena_SOURCE_DIR}/lib/cmake/lzokay/lzokayConfig.cmake)
|
||||
add_library(lzokay ALIAS lzokay::lzokay)
|
||||
include(extern/athena/atdna/atdnaHelpers.cmake)
|
||||
endif()
|
||||
|
||||
set(DATA_SPEC_LIBS RetroDataSpec AssetNameMap)
|
||||
set(HECL_DATASPEC_DECLS
|
||||
|
@ -369,27 +411,52 @@ set(HECL_DATASPEC_PUSHES
|
|||
hecl::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP3PC);
|
||||
hecl::Database::DATA_SPEC_REGISTRY.push_back(&DataSpec::SpecEntMP3ORIG);")
|
||||
|
||||
add_subdirectory(extern/athena)
|
||||
add_subdirectory(extern/boo)
|
||||
add_subdirectory(hecl/shaderc)
|
||||
add_subdirectory(extern/nod EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(extern/boo EXCLUDE_FROM_ALL)
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(shaderc
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/hecl/shaderc"
|
||||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config Release --target install)
|
||||
|
||||
function(shaderc out)
|
||||
if(IS_ABSOLUTE ${out})
|
||||
set(theOut ${out})
|
||||
else()
|
||||
set(theOut ${CMAKE_CURRENT_BINARY_DIR}/${out})
|
||||
endif()
|
||||
unset(theInsList)
|
||||
foreach(in ${ARGN})
|
||||
if(IS_ABSOLUTE ${in})
|
||||
list(APPEND theInsList ${in})
|
||||
else()
|
||||
list(APPEND theInsList ${CMAKE_CURRENT_SOURCE_DIR}/${in})
|
||||
endif()
|
||||
endforeach()
|
||||
get_filename_component(outDir ${theOut} DIRECTORY)
|
||||
file(MAKE_DIRECTORY ${outDir})
|
||||
file(RELATIVE_PATH outRel ${CMAKE_BINARY_DIR} ${theOut})
|
||||
ExternalProject_Get_Property(shaderc INSTALL_DIR)
|
||||
add_custom_command(OUTPUT ${theOut}.cpp ${theOut}.hpp
|
||||
COMMAND "${INSTALL_DIR}/bin/shaderc" ARGS -o ${theOut} ${theInsList}
|
||||
DEPENDS ${theInsList} shaderc
|
||||
COMMENT "Compiling shader ${outRel}.shader")
|
||||
endfunction()
|
||||
|
||||
include(hecl/ApplicationTools.cmake)
|
||||
add_subdirectory(specter/shaders)
|
||||
add_subdirectory(Shaders)
|
||||
add_subdirectory(extern/libSquish)
|
||||
add_subdirectory(extern/libpng)
|
||||
add_subdirectory(extern/libjpeg-turbo)
|
||||
add_subdirectory(hecl)
|
||||
add_subdirectory(extern/zeus)
|
||||
add_subdirectory(extern/libSquish EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(extern/libpng EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(extern/libjpeg-turbo EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(hecl EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(extern/zeus EXCLUDE_FROM_ALL)
|
||||
target_include_directories(hecl-full PRIVATE ${CMAKE_SOURCE_DIR})
|
||||
target_include_directories(hecl-light PRIVATE ${CMAKE_SOURCE_DIR})
|
||||
target_link_libraries(hecl-full PRIVATE zeus nod)
|
||||
target_link_libraries(hecl-light PRIVATE zeus nod)
|
||||
|
||||
if(NOT TARGET bintoc)
|
||||
# Use native if cross compiling
|
||||
find_package(hecl-bintoc REQUIRED)
|
||||
endif()
|
||||
|
||||
bintoc(CModelShaders.common.glsl.cpp Shaders/CModelShaders.common.glsl CMODELSHADERS_COMMON_GLSL)
|
||||
bintoc(CModelShaders.vert.glsl.cpp Shaders/CModelShaders.vert.glsl CMODELSHADERS_VERT_GLSL)
|
||||
bintoc(CModelShaders.frag.glsl.cpp Shaders/CModelShaders.frag.glsl CMODELSHADERS_FRAG_GLSL)
|
||||
|
@ -414,21 +481,23 @@ if(NOT TARGET atdna)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(extern/amuse)
|
||||
add_subdirectory(extern/freetype2)
|
||||
add_subdirectory(extern/amuse EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(extern/freetype2 EXCLUDE_FROM_ALL)
|
||||
if (NOT MSVC)
|
||||
target_compile_options(freetype PRIVATE -Wno-implicit-fallthrough)
|
||||
endif()
|
||||
add_subdirectory(specter)
|
||||
endif ()
|
||||
add_subdirectory(specter EXCLUDE_FROM_ALL)
|
||||
target_include_directories(specter PRIVATE ${CMAKE_SOURCE_DIR})
|
||||
target_link_libraries(specter PRIVATE nod)
|
||||
add_subdirectory(assetnameparser)
|
||||
if (NOT CMAKE_CROSSCOMPILING)
|
||||
add_subdirectory(assetnameparser)
|
||||
endif ()
|
||||
add_compile_definitions(URDE_ZIP_INPUT_STREAM=1) # Enable CZipInputStream now that zlib header is known
|
||||
add_subdirectory(DataSpec)
|
||||
add_subdirectory(extern/kabufuda)
|
||||
add_subdirectory(extern/kabufuda EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(Editor)
|
||||
|
||||
add_subdirectory(extern/jbus)
|
||||
add_subdirectory(extern/jbus EXCLUDE_FROM_ALL)
|
||||
set(JBUS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/jbus/include)
|
||||
|
||||
set(CLIENT_SOURCES
|
||||
|
@ -436,10 +505,10 @@ set(CLIENT_SOURCES
|
|||
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryBase.cpp
|
||||
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryMP1.hpp
|
||||
${CMAKE_SOURCE_DIR}/Editor/ProjectResourceFactoryMP1.cpp)
|
||||
add_subdirectory(NESEmulator)
|
||||
add_subdirectory(NESEmulator EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(Runtime)
|
||||
add_subdirectory(mpcksum)
|
||||
add_subdirectory(gbalink)
|
||||
add_subdirectory(mpcksum EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(gbalink EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(visigen)
|
||||
|
||||
add_dependencies(hecl visigen)
|
||||
|
@ -467,3 +536,34 @@ if (NOT WINDOWS_STORE AND NOT NX)
|
|||
endif()
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
|
||||
|
||||
# Packaging logic
|
||||
list(APPEND BINARY_TARGETS metaforce hecl visigen)
|
||||
set(DSYM_ONLY_TARGETS "")
|
||||
if (TARGET crashpad_handler)
|
||||
list(APPEND BINARY_TARGETS crashpad_handler)
|
||||
endif ()
|
||||
set(BIN_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
if (TARGET metaforce-gui)
|
||||
if (APPLE)
|
||||
# app bundle already has all needed binaries
|
||||
install(TARGETS metaforce-gui DESTINATION ${BIN_PREFIX})
|
||||
list(APPEND DSYM_ONLY_TARGETS metaforce-gui)
|
||||
# we have to rename here, cmake is inflexible about bundle naming
|
||||
install(CODE "execute_process(COMMAND rm -fr ${BIN_PREFIX}/Metaforce.app)")
|
||||
install(CODE "execute_process(COMMAND mv ${BIN_PREFIX}/metaforce-gui.app ${BIN_PREFIX}/Metaforce.app)")
|
||||
set(BIN_PREFIX "${BIN_PREFIX}/Metaforce.app/Contents/MacOS")
|
||||
else()
|
||||
list(APPEND BINARY_TARGETS metaforce-gui)
|
||||
endif ()
|
||||
endif ()
|
||||
install(TARGETS ${BINARY_TARGETS} DESTINATION ${BIN_PREFIX})
|
||||
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
||||
foreach (target IN LISTS BINARY_TARGETS DSYM_ONLY_TARGETS)
|
||||
if (WIN32)
|
||||
install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${BIN_PREFIX} OPTIONAL)
|
||||
elseif (APPLE)
|
||||
install(CODE "execute_process(COMMAND dsymutil ${BIN_PREFIX}/${target})")
|
||||
endif ()
|
||||
endforeach ()
|
||||
endif ()
|
||||
|
|
|
@ -5,7 +5,7 @@ find_library(M_LIB m)
|
|||
if(NOT M_LIB)
|
||||
unset(M_LIB CACHE)
|
||||
endif()
|
||||
target_link_libraries(packbadge ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${M_LIB})
|
||||
target_link_libraries(packbadge PRIVATE ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${M_LIB})
|
||||
target_include_directories(packbadge PRIVATE ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR})
|
||||
|
||||
##################
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
add_executable(genlocales genlocales.cpp)
|
||||
target_link_libraries(genlocales fmt athena-core)
|
||||
#add_executable(genlocales genlocales.cpp)
|
||||
#target_link_libraries(genlocales fmt athena-core)
|
||||
#
|
||||
#set(LOCALES_IN en_US.yaml en_GB.yaml ja_JP.yaml)
|
||||
#set(LOCALES_OUT ${CMAKE_CURRENT_BINARY_DIR}/locales-inl.hpp)
|
||||
#add_custom_command(OUTPUT ${LOCALES_OUT} COMMAND $<TARGET_FILE:genlocales>
|
||||
# ARGS ${LOCALES_OUT} ${LOCALES_IN}
|
||||
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
# DEPENDS genlocales ${LOCALES_IN})
|
||||
|
||||
set(LOCALES_IN en_US.yaml en_GB.yaml ja_JP.yaml)
|
||||
set(LOCALES_OUT ${CMAKE_CURRENT_BINARY_DIR}/locales-inl.hpp)
|
||||
add_custom_command(OUTPUT ${LOCALES_OUT} COMMAND $<TARGET_FILE:genlocales>
|
||||
ARGS ${LOCALES_OUT} ${LOCALES_IN}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
DEPENDS genlocales ${LOCALES_IN})
|
||||
|
||||
add_library(UrdeLocales ${LOCALES_OUT} locale.hpp locale.cpp)
|
||||
add_library(UrdeLocales locales-inl.hpp locale.hpp locale.cpp)
|
||||
target_link_libraries(UrdeLocales fmt)
|
||||
target_include_directories(UrdeLocales PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
/* Locales */
|
||||
enum class ELocale {
|
||||
Invalid = -1,
|
||||
en_US,
|
||||
en_GB,
|
||||
ja_JP,
|
||||
MAXLocale
|
||||
};
|
||||
struct en_US { static constexpr auto Name = "en_US"sv; static constexpr auto FullName = "US English"sv; };
|
||||
struct en_GB { static constexpr auto Name = "en_GB"sv; static constexpr auto FullName = "British English"sv; };
|
||||
struct ja_JP { static constexpr auto Name = "ja_JP"sv; static constexpr auto FullName = "日本語"sv; };
|
||||
|
||||
using DefaultLocale = en_US;
|
||||
template<typename L, typename K> struct Lookup {
|
||||
static_assert(!std::is_same_v<L, DefaultLocale>, "The default locale must translate all keys");
|
||||
static constexpr auto Value() { return Lookup<DefaultLocale, K>::Value(); }
|
||||
};
|
||||
|
||||
/* Keys */
|
||||
struct color {};
|
||||
struct branch {};
|
||||
struct commit {};
|
||||
struct release {};
|
||||
struct date {};
|
||||
struct new_project {};
|
||||
struct open_project {};
|
||||
struct extract_game {};
|
||||
struct name {};
|
||||
struct type {};
|
||||
struct size {};
|
||||
struct directory {};
|
||||
struct file {};
|
||||
struct file_name {};
|
||||
struct cancel {};
|
||||
struct system_locations {};
|
||||
struct recent_projects {};
|
||||
struct recent_files {};
|
||||
struct scroll_left {};
|
||||
struct scroll_right {};
|
||||
struct ok {};
|
||||
struct boundary_action {};
|
||||
struct split {};
|
||||
struct join {};
|
||||
struct hecl_project {};
|
||||
struct no_access_as_dir {};
|
||||
struct file_field_empty {};
|
||||
struct overwrite_confirm {};
|
||||
struct directory_field_empty {};
|
||||
struct no_overwrite_file {};
|
||||
struct no_overwrite_project {};
|
||||
struct no_access_as_file {};
|
||||
struct space_types {};
|
||||
struct resource_browser {};
|
||||
struct effect_editor {};
|
||||
struct model_viewer {};
|
||||
struct information_center {};
|
||||
struct game_mode {};
|
||||
struct version {};
|
||||
|
||||
/* en_US */
|
||||
template<> struct Lookup<en_US, color> { static constexpr auto Value() { return FMT_STRING("Color"); } };
|
||||
template<> struct Lookup<en_US, branch> { static constexpr auto Value() { return FMT_STRING("Branch"); } };
|
||||
template<> struct Lookup<en_US, commit> { static constexpr auto Value() { return FMT_STRING("Commit"); } };
|
||||
template<> struct Lookup<en_US, release> { static constexpr auto Value() { return FMT_STRING("Release"); } };
|
||||
template<> struct Lookup<en_US, date> { static constexpr auto Value() { return FMT_STRING("Date"); } };
|
||||
template<> struct Lookup<en_US, new_project> { static constexpr auto Value() { return FMT_STRING("New Project"); } };
|
||||
template<> struct Lookup<en_US, open_project> { static constexpr auto Value() { return FMT_STRING("Open Project"); } };
|
||||
template<> struct Lookup<en_US, extract_game> { static constexpr auto Value() { return FMT_STRING("Extract Game"); } };
|
||||
template<> struct Lookup<en_US, name> { static constexpr auto Value() { return FMT_STRING("Name"); } };
|
||||
template<> struct Lookup<en_US, type> { static constexpr auto Value() { return FMT_STRING("Type"); } };
|
||||
template<> struct Lookup<en_US, size> { static constexpr auto Value() { return FMT_STRING("Size"); } };
|
||||
template<> struct Lookup<en_US, directory> { static constexpr auto Value() { return FMT_STRING("Directory"); } };
|
||||
template<> struct Lookup<en_US, file> { static constexpr auto Value() { return FMT_STRING("File"); } };
|
||||
template<> struct Lookup<en_US, file_name> { static constexpr auto Value() { return FMT_STRING("File Name"); } };
|
||||
template<> struct Lookup<en_US, cancel> { static constexpr auto Value() { return FMT_STRING("Cancel"); } };
|
||||
template<> struct Lookup<en_US, system_locations> { static constexpr auto Value() { return FMT_STRING("System Locations"); } };
|
||||
template<> struct Lookup<en_US, recent_projects> { static constexpr auto Value() { return FMT_STRING("Recent Projects"); } };
|
||||
template<> struct Lookup<en_US, recent_files> { static constexpr auto Value() { return FMT_STRING("Recent Files"); } };
|
||||
template<> struct Lookup<en_US, scroll_left> { static constexpr auto Value() { return FMT_STRING("Scroll Left"); } };
|
||||
template<> struct Lookup<en_US, scroll_right> { static constexpr auto Value() { return FMT_STRING("Scroll Right"); } };
|
||||
template<> struct Lookup<en_US, ok> { static constexpr auto Value() { return FMT_STRING("OK"); } };
|
||||
template<> struct Lookup<en_US, boundary_action> { static constexpr auto Value() { return FMT_STRING("Boundary Action"); } };
|
||||
template<> struct Lookup<en_US, split> { static constexpr auto Value() { return FMT_STRING("Split"); } };
|
||||
template<> struct Lookup<en_US, join> { static constexpr auto Value() { return FMT_STRING("Join"); } };
|
||||
template<> struct Lookup<en_US, hecl_project> { static constexpr auto Value() { return FMT_STRING("HECL Project"); } };
|
||||
template<> struct Lookup<en_US, no_access_as_dir> { static constexpr auto Value() { return FMT_STRING("Unable to access '{}' as directory"); } };
|
||||
template<> struct Lookup<en_US, file_field_empty> { static constexpr auto Value() { return FMT_STRING("Unable to save empty file"); } };
|
||||
template<> struct Lookup<en_US, overwrite_confirm> { static constexpr auto Value() { return FMT_STRING("Overwrite '{}'?"); } };
|
||||
template<> struct Lookup<en_US, directory_field_empty> { static constexpr auto Value() { return FMT_STRING("Unable to make empty-named directory"); } };
|
||||
template<> struct Lookup<en_US, no_overwrite_file> { static constexpr auto Value() { return FMT_STRING("Unable to make directory over file"); } };
|
||||
template<> struct Lookup<en_US, no_overwrite_project> { static constexpr auto Value() { return FMT_STRING("Unable to make project within existing project"); } };
|
||||
template<> struct Lookup<en_US, no_access_as_file> { static constexpr auto Value() { return FMT_STRING("Unable to access '{}' as file"); } };
|
||||
template<> struct Lookup<en_US, space_types> { static constexpr auto Value() { return FMT_STRING("Space Types"); } };
|
||||
template<> struct Lookup<en_US, resource_browser> { static constexpr auto Value() { return FMT_STRING("Resource Browser"); } };
|
||||
template<> struct Lookup<en_US, effect_editor> { static constexpr auto Value() { return FMT_STRING("Effect Editor"); } };
|
||||
template<> struct Lookup<en_US, model_viewer> { static constexpr auto Value() { return FMT_STRING("Model Viewer"); } };
|
||||
template<> struct Lookup<en_US, information_center> { static constexpr auto Value() { return FMT_STRING("Information Center"); } };
|
||||
template<> struct Lookup<en_US, game_mode> { static constexpr auto Value() { return FMT_STRING("Game Mode"); } };
|
||||
template<> struct Lookup<en_US, version> { static constexpr auto Value() { return FMT_STRING("Version"); } };
|
||||
|
||||
/* en_GB */
|
||||
template<> struct Lookup<en_GB, color> { static constexpr auto Value() { return FMT_STRING("Colour"); } };
|
||||
|
||||
/* ja_JP */
|
||||
template<> struct Lookup<ja_JP, color> { static constexpr auto Value() { return FMT_STRING("色"); } };
|
||||
template<> struct Lookup<ja_JP, branch> { static constexpr auto Value() { return FMT_STRING("分派"); } };
|
||||
template<> struct Lookup<ja_JP, commit> { static constexpr auto Value() { return FMT_STRING("預ける"); } };
|
||||
template<> struct Lookup<ja_JP, date> { static constexpr auto Value() { return FMT_STRING("年月日"); } };
|
||||
template<> struct Lookup<ja_JP, new_project> { static constexpr auto Value() { return FMT_STRING("新しいプロジェクト"); } };
|
||||
template<> struct Lookup<ja_JP, open_project> { static constexpr auto Value() { return FMT_STRING("プロジェクトを開きます"); } };
|
||||
template<> struct Lookup<ja_JP, extract_game> { static constexpr auto Value() { return FMT_STRING("ビデオゲームを抽出"); } };
|
||||
template<> struct Lookup<ja_JP, name> { static constexpr auto Value() { return FMT_STRING("名"); } };
|
||||
template<> struct Lookup<ja_JP, type> { static constexpr auto Value() { return FMT_STRING("タイプ"); } };
|
||||
template<> struct Lookup<ja_JP, size> { static constexpr auto Value() { return FMT_STRING("サイズ"); } };
|
||||
template<> struct Lookup<ja_JP, directory> { static constexpr auto Value() { return FMT_STRING("ディレクトリ"); } };
|
||||
template<> struct Lookup<ja_JP, file> { static constexpr auto Value() { return FMT_STRING("ファイル"); } };
|
||||
template<> struct Lookup<ja_JP, file_name> { static constexpr auto Value() { return FMT_STRING("ファイル名"); } };
|
||||
template<> struct Lookup<ja_JP, cancel> { static constexpr auto Value() { return FMT_STRING("キャンセル"); } };
|
||||
template<> struct Lookup<ja_JP, system_locations> { static constexpr auto Value() { return FMT_STRING("システムの場所"); } };
|
||||
template<> struct Lookup<ja_JP, recent_projects> { static constexpr auto Value() { return FMT_STRING("最近使ったプロジェクト"); } };
|
||||
template<> struct Lookup<ja_JP, recent_files> { static constexpr auto Value() { return FMT_STRING("最近使用したファイル"); } };
|
||||
|
||||
template <typename Action, typename... Args>
|
||||
constexpr auto Do(ELocale l, Action act, Args&&... args) {
|
||||
switch (l) {
|
||||
default:
|
||||
case ELocale::en_US:
|
||||
return act.template Do<en_US>(std::forward<Args>(args)...);
|
||||
case ELocale::en_GB:
|
||||
return act.template Do<en_GB>(std::forward<Args>(args)...);
|
||||
case ELocale::ja_JP:
|
||||
return act.template Do<ja_JP>(std::forward<Args>(args)...);
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit a87e8bb39f8548f1418a5f68353c9fca890ba5df
|
||||
Subproject commit 8558ca1b5111ebe83ee44b1200b0b0d1d94f2fa2
|
|
@ -1 +1 @@
|
|||
Subproject commit 6335cb09fe5046984e8baa9b5a65de837037e70c
|
||||
Subproject commit 09b788d20b91aba8b3c9084bcf5e8a61f03935e8
|
|
@ -1,53 +1,58 @@
|
|||
if(NOT WIN32 AND NOT APPLE AND NOT NX) # remove WIN32 when specter/freetype is gone
|
||||
find_library(PNG_LIB NAMES png libpng)
|
||||
endif()
|
||||
if(NOT PNG_LIB)
|
||||
message(STATUS "Using HECL's built-in libpng")
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm(64)?")
|
||||
set(INTRINSICS
|
||||
if (APPLE)
|
||||
# only consider static libs
|
||||
find_library(PNG_LIB NAMES libpng.a PATHS ${PNG_DIR} NO_DEFAULT_PATHS NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_SYSTEM_PATH)
|
||||
elseif (NOT WIN32 AND NOT NX) # remove WIN32 when specter/freetype is gone
|
||||
find_library(PNG_LIB NAMES png libpng PATHS ${PNG_DIR})
|
||||
endif ()
|
||||
if (NOT PNG_LIB)
|
||||
message(STATUS "Using HECL's built-in libpng")
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm(64)?" OR (APPLE AND "arm64" IN_LIST CMAKE_OSX_ARCHITECTURES))
|
||||
list(APPEND INTRINSICS
|
||||
arm/arm_init.c
|
||||
arm/filter_neon.S
|
||||
arm/filter_neon_intrinsics.c
|
||||
arm/palette_neon_intrinsics.c)
|
||||
elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL x86_64)
|
||||
set(INTRINSICS
|
||||
endif ()
|
||||
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR (APPLE AND "x86_64" IN_LIST CMAKE_OSX_ARCHITECTURES))
|
||||
list(APPEND INTRINSICS
|
||||
intel/filter_sse2_intrinsics.c
|
||||
intel/intel_init.c)
|
||||
endif()
|
||||
add_library(png
|
||||
png.h
|
||||
pngconf.h
|
||||
pngdebug.h
|
||||
pnginfo.h
|
||||
pngpriv.h
|
||||
pngstruct.h
|
||||
pnglibconf.h
|
||||
endif ()
|
||||
add_library(png
|
||||
png.h
|
||||
pngconf.h
|
||||
pngdebug.h
|
||||
pnginfo.h
|
||||
pngpriv.h
|
||||
pngstruct.h
|
||||
pnglibconf.h
|
||||
|
||||
png.c
|
||||
pngerror.c
|
||||
pngget.c
|
||||
pngmem.c
|
||||
pngpread.c
|
||||
pngread.c
|
||||
pngrio.c
|
||||
pngrtran.c
|
||||
pngrutil.c
|
||||
pngset.c
|
||||
pngtrans.c
|
||||
pngwio.c
|
||||
pngwrite.c
|
||||
pngwtran.c
|
||||
pngwutil.c
|
||||
${INTRINSICS})
|
||||
if(APPLE)
|
||||
png.c
|
||||
pngerror.c
|
||||
pngget.c
|
||||
pngmem.c
|
||||
pngpread.c
|
||||
pngread.c
|
||||
pngrio.c
|
||||
pngrtran.c
|
||||
pngrutil.c
|
||||
pngset.c
|
||||
pngtrans.c
|
||||
pngwio.c
|
||||
pngwrite.c
|
||||
pngwtran.c
|
||||
pngwutil.c
|
||||
${INTRINSICS})
|
||||
if (APPLE)
|
||||
target_compile_options(png PRIVATE -Wno-implicit-fallthrough)
|
||||
endif()
|
||||
target_link_libraries(png PUBLIC ${ZLIB_LIBRARIES})
|
||||
target_include_directories(png PUBLIC ${ZLIB_INCLUDE_DIR})
|
||||
set(PNG_LIBRARIES png CACHE PATH "PNG libraries" FORCE)
|
||||
set(PNG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "PNG include path" FORCE)
|
||||
else()
|
||||
set(PNG_LIBRARIES ${PNG_LIB} CACHE PATH "PNG libraries" FORCE)
|
||||
find_path(PNG_INCLUDE_DIR png.h)
|
||||
set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE PATH "PNG include path" FORCE)
|
||||
endif()
|
||||
endif ()
|
||||
target_link_libraries(png PUBLIC ${ZLIB_LIBRARIES})
|
||||
target_include_directories(png PUBLIC ${ZLIB_INCLUDE_DIR})
|
||||
set(PNG_LIBRARIES png CACHE PATH "PNG libraries" FORCE)
|
||||
set(PNG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH "PNG include path" FORCE)
|
||||
else ()
|
||||
set(PNG_LIBRARIES ${PNG_LIB} ${ZLIB_LIBRARIES} CACHE PATH "PNG libraries" FORCE)
|
||||
find_path(PNG_INCLUDE_DIR png.h PATHS "${PNG_LIB}/../../include" NO_DEFAULT_PATHS NO_CMAKE_FIND_ROOT_PATH NO_CMAKE_SYSTEM_PATH)
|
||||
set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE PATH "PNG include path" FORCE)
|
||||
message(STATUS "Using libpng at ${PNG_LIB}, include: ${PNG_INCLUDE_DIR}")
|
||||
endif ()
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 311d20532e5c94d605f6725f1ba2b9a4b196aef1
|
||||
Subproject commit d14b798b5f79c566ba6e6ca0434ce155f2b81d1b
|
|
@ -52,12 +52,12 @@ endforeach()
|
|||
|
||||
configure_file(include/hecl/ApplicationReps.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/ApplicationReps.hpp @ONLY)
|
||||
|
||||
add_subdirectory(bintoc)
|
||||
|
||||
if(NOT TARGET bintoc)
|
||||
# Use native if cross compiling
|
||||
find_package(hecl-bintoc REQUIRED)
|
||||
endif()
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(bintoc
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bintoc"
|
||||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --config Release --target install)
|
||||
include(bintoc/bintocHelpers.cmake)
|
||||
|
||||
if(NOT TARGET atdna)
|
||||
# Import native atdna if cross-compiling
|
||||
|
|
|
@ -1,62 +1,9 @@
|
|||
if(NOT CMAKE_CROSSCOMPILING)
|
||||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
|
||||
cmake_policy(VERSION 3.15...3.20)
|
||||
project(bintoc LANGUAGES C)
|
||||
|
||||
add_executable(bintoc bintoc.c)
|
||||
target_include_directories(bintoc PRIVATE ${ZLIB_INCLUDE_DIR})
|
||||
target_link_libraries(bintoc ${ZLIB_LIBRARIES})
|
||||
function(bintoc out in sym)
|
||||
if(IS_ABSOLUTE ${out})
|
||||
set(theOut ${out})
|
||||
else()
|
||||
set(theOut ${CMAKE_CURRENT_BINARY_DIR}/${out})
|
||||
endif()
|
||||
if(IS_ABSOLUTE ${in})
|
||||
set(theIn ${in})
|
||||
else()
|
||||
set(theIn ${CMAKE_CURRENT_SOURCE_DIR}/${in})
|
||||
endif()
|
||||
get_filename_component(outDir ${theOut} DIRECTORY)
|
||||
file(MAKE_DIRECTORY ${outDir})
|
||||
add_custom_command(OUTPUT ${theOut}
|
||||
COMMAND $<TARGET_FILE:bintoc> ARGS ${theIn} ${theOut} ${sym}
|
||||
DEPENDS ${theIn} bintoc)
|
||||
endfunction()
|
||||
function(bintoc_compress out in sym)
|
||||
if(IS_ABSOLUTE ${out})
|
||||
set(theOut ${out})
|
||||
else()
|
||||
set(theOut ${CMAKE_CURRENT_BINARY_DIR}/${out})
|
||||
endif()
|
||||
if(IS_ABSOLUTE ${in})
|
||||
set(theIn ${in})
|
||||
else()
|
||||
set(theIn ${CMAKE_CURRENT_SOURCE_DIR}/${in})
|
||||
endif()
|
||||
get_filename_component(outDir ${theOut} DIRECTORY)
|
||||
file(MAKE_DIRECTORY ${outDir})
|
||||
add_custom_command(OUTPUT ${theOut}
|
||||
COMMAND $<TARGET_FILE:bintoc> ARGS --compress ${theIn} ${theOut} ${sym}
|
||||
DEPENDS ${theIn} bintoc)
|
||||
endfunction()
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_link_libraries(bintoc PRIVATE ZLIB::ZLIB)
|
||||
|
||||
##################
|
||||
# Package Export #
|
||||
##################
|
||||
|
||||
# Add all targets to the build-tree export set
|
||||
export(TARGETS bintoc FILE "${CMAKE_CURRENT_BINARY_DIR}/hecl-bintocTargets.cmake")
|
||||
|
||||
# Export the package for use from the build-tree
|
||||
# (this registers the build-tree with a global CMake-registry)
|
||||
export(PACKAGE hecl-bintoc)
|
||||
|
||||
# Create the atdnaConfig.cmake
|
||||
# ... for the build tree
|
||||
configure_file(hecl-bintocConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/hecl-bintocConfig.cmake" @ONLY)
|
||||
# ... for the install tree
|
||||
configure_file(hecl-bintocConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hecl-bintocConfig.cmake" @ONLY)
|
||||
# ... for both
|
||||
configure_file(hecl-bintocConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/hecl-bintocConfigVersion.cmake" @ONLY)
|
||||
|
||||
else()
|
||||
# Use native if cross compiling
|
||||
find_package(hecl-bintoc REQUIRED)
|
||||
endif()
|
||||
install(TARGETS bintoc DESTINATION bin)
|
|
@ -1,13 +1,3 @@
|
|||
# - Config file for the bintoc package
|
||||
|
||||
# Compute paths
|
||||
get_filename_component(BINTOC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
||||
|
||||
# Our library dependencies (contains definitions for IMPORTED targets)
|
||||
if(NOT TARGET bintoc AND NOT bintoc_BINARY_DIR)
|
||||
include("${BINTOC_CMAKE_DIR}/hecl-bintocTargets.cmake")
|
||||
endif()
|
||||
|
||||
function(bintoc out in sym)
|
||||
if(IS_ABSOLUTE ${out})
|
||||
set(theOut ${out})
|
||||
|
@ -21,9 +11,10 @@ function(bintoc out in sym)
|
|||
endif()
|
||||
get_filename_component(outDir ${theOut} DIRECTORY)
|
||||
file(MAKE_DIRECTORY ${outDir})
|
||||
ExternalProject_Get_Property(bintoc INSTALL_DIR)
|
||||
add_custom_command(OUTPUT ${theOut}
|
||||
COMMAND $<TARGET_FILE:bintoc> ARGS ${theIn} ${theOut} ${sym}
|
||||
DEPENDS ${theIn})
|
||||
COMMAND "${INSTALL_DIR}/bin/bintoc" ARGS ${theIn} ${theOut} ${sym}
|
||||
DEPENDS ${theIn} bintoc)
|
||||
endfunction()
|
||||
|
||||
function(bintoc_compress out in sym)
|
||||
|
@ -39,7 +30,8 @@ function(bintoc_compress out in sym)
|
|||
endif()
|
||||
get_filename_component(outDir ${theOut} DIRECTORY)
|
||||
file(MAKE_DIRECTORY ${outDir})
|
||||
ExternalProject_Get_Property(bintoc INSTALL_DIR)
|
||||
add_custom_command(OUTPUT ${theOut}
|
||||
COMMAND $<TARGET_FILE:bintoc> ARGS --compress ${theIn} ${theOut} ${sym}
|
||||
DEPENDS ${theIn})
|
||||
COMMAND "${INSTALL_DIR}/bin/bintoc" ARGS --compress ${theIn} ${theOut} ${sym}
|
||||
DEPENDS ${theIn} bintoc)
|
||||
endfunction()
|
|
@ -1,12 +0,0 @@
|
|||
set(PACKAGE_VERSION "@BINTOC_VERSION@")
|
||||
|
||||
# Check whether the requested PACKAGE_FIND_VERSION is compatible
|
||||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
|
@ -87,12 +87,6 @@ target_link_libraries(hecl-light PUBLIC ${HECL_APPLICATION_REPS_TARGETS_LIST} bo
|
|||
target_atdna(hecl-light atdna_HMDLMeta_light.cpp ../include/hecl/HMDLMeta.hpp)
|
||||
target_atdna(hecl-light atdna_CVar_light.cpp ../include/hecl/CVar.hpp)
|
||||
|
||||
add_library(hecl-compilers Compilers.cpp WideStringConvert.cpp)
|
||||
get_target_property(BOO_INCLUDES boo INTERFACE_INCLUDE_DIRECTORIES)
|
||||
target_include_directories(hecl-compilers PUBLIC ../include ${BOO_INCLUDES})
|
||||
target_link_libraries(hecl-compilers PUBLIC athena-core logvisor xxhash
|
||||
glslang OSDependent OGLCompiler SPIRV glslang-default-resource-limits)
|
||||
|
||||
if(COMMAND add_sanitizers)
|
||||
add_sanitizers(hecl-full)
|
||||
add_sanitizers(hecl-light)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <logvisor/logvisor.hpp>
|
||||
#include <utf8proc.h>
|
||||
#include <athena/utf8proc.h>
|
||||
|
||||
namespace hecl {
|
||||
static logvisor::Module Log("hecl-wsconv");
|
||||
|
|
|
@ -1,7 +1,91 @@
|
|||
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
|
||||
cmake_policy(VERSION 3.15...3.20)
|
||||
project(shaderc LANGUAGES C CXX)
|
||||
|
||||
if (MSVC)
|
||||
# Shaddup MSVC
|
||||
add_compile_definitions(UNICODE=1 _UNICODE=1 __SSE__=1
|
||||
_CRT_SECURE_NO_WARNINGS=1 D_SCL_SECURE_NO_WARNINGS=1
|
||||
_SCL_SECURE_NO_DEPRECATE=1 _CRT_NONSTDC_NO_WARNINGS=1
|
||||
_ENABLE_EXTENDED_ALIGNED_STORAGE=1 NOMINMAX=1)
|
||||
add_compile_options(/IGNORE:4221
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4018>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4800>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4005>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4311>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4068>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4267>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4244>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4200>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4305>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4067>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4146>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4309>
|
||||
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:/wd4805>
|
||||
${VS_OPTIONS})
|
||||
|
||||
string(REPLACE "/GR " "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REPLACE " /EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
add_compile_options(
|
||||
# Disable exceptions
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/EHsc->
|
||||
|
||||
# Disable RTTI
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/GR->
|
||||
|
||||
# Enforce various standards compliant behavior.
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/permissive->
|
||||
|
||||
# Enable standard volatile semantics.
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/volatile:iso>
|
||||
|
||||
# Reports the proper value for the __cplusplus preprocessor macro.
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>
|
||||
|
||||
# Use latest C++ standard.
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/std:c++latest>
|
||||
)
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
# Flags for MSVC (not clang-cl)
|
||||
add_compile_options(
|
||||
# Allow constexpr variables to have explicit external linkage.
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/Zc:externConstexpr>
|
||||
|
||||
# Assume that new throws exceptions, allowing better code generation.
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/Zc:throwingNew>
|
||||
|
||||
# Link-time Code Generation for Release builds
|
||||
$<$<CONFIG:Release>:/GL>
|
||||
)
|
||||
|
||||
# Link-time Code Generation for Release builds
|
||||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/RELEASE /LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG /RELEASE /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:cv,fixup")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif ()
|
||||
|
||||
# two step: --target shaderc, --target install
|
||||
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
|
||||
|
||||
add_subdirectory(../../extern/athena athena)
|
||||
add_subdirectory(../../extern/boo boo)
|
||||
|
||||
add_library(hecl-compilers ../lib/Compilers.cpp ../lib/WideStringConvert.cpp)
|
||||
get_target_property(BOO_INCLUDES boo INTERFACE_INCLUDE_DIRECTORIES)
|
||||
target_include_directories(hecl-compilers PUBLIC ../include ${BOO_INCLUDES})
|
||||
target_link_libraries(hecl-compilers PUBLIC athena-core logvisor xxhash
|
||||
glslang OSDependent OGLCompiler SPIRV glslang-default-resource-limits)
|
||||
|
||||
add_library(shaderc_lib shaderc.cpp shaderc.hpp)
|
||||
target_link_libraries(shaderc_lib PUBLIC hecl-compilers athena-core logvisor)
|
||||
add_executable(shaderc main.cpp)
|
||||
target_link_libraries(shaderc shaderc_lib)
|
||||
|
||||
if (NOT WIN32)
|
||||
target_link_libraries(shaderc pthread)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
|
@ -10,29 +94,5 @@ if (NOT WIN32)
|
|||
target_link_libraries(shaderc dl)
|
||||
endif()
|
||||
endif()
|
||||
if(COMMAND add_sanitizers)
|
||||
add_sanitizers(shaderc_lib)
|
||||
add_sanitizers(shaderc)
|
||||
endif()
|
||||
|
||||
function(shaderc out)
|
||||
if(IS_ABSOLUTE ${out})
|
||||
set(theOut ${out})
|
||||
else()
|
||||
set(theOut ${CMAKE_CURRENT_BINARY_DIR}/${out})
|
||||
endif()
|
||||
unset(theInsList)
|
||||
foreach(in ${ARGN})
|
||||
if(IS_ABSOLUTE ${in})
|
||||
list(APPEND theInsList ${in})
|
||||
else()
|
||||
list(APPEND theInsList ${CMAKE_CURRENT_SOURCE_DIR}/${in})
|
||||
endif()
|
||||
endforeach()
|
||||
get_filename_component(outDir ${theOut} DIRECTORY)
|
||||
file(MAKE_DIRECTORY ${outDir})
|
||||
file(RELATIVE_PATH outRel ${CMAKE_BINARY_DIR} ${theOut})
|
||||
add_custom_command(OUTPUT ${theOut}.cpp ${theOut}.hpp
|
||||
COMMAND $<TARGET_FILE:shaderc> ARGS -o ${theOut} ${theInsList}
|
||||
DEPENDS ${theInsList} shaderc COMMENT "Compiling shader ${outRel}.shader")
|
||||
endfunction()
|
||||
install(TARGETS shaderc DESTINATION bin)
|
|
@ -144,20 +144,6 @@ elseif (APPLE)
|
|||
set_source_files_properties(platforms/mac/mainicon.icns PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION Resources
|
||||
)
|
||||
add_custom_command(
|
||||
TARGET metaforce-gui POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:metaforce> $<TARGET_FILE_DIR:metaforce-gui>
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:hecl> $<TARGET_FILE_DIR:metaforce-gui>
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:visigen> $<TARGET_FILE_DIR:metaforce-gui>
|
||||
DEPENDS metaforce hecl visigen
|
||||
)
|
||||
if (NOT "${SENTRY_DSN}" STREQUAL "")
|
||||
add_custom_command(
|
||||
TARGET metaforce-gui POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:crashpad_handler> $<TARGET_FILE_DIR:metaforce-gui>
|
||||
DEPENDS crashpad_handler
|
||||
)
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
add_subdirectory(platforms/freedesktop)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "specter/RootView.hpp"
|
||||
#include "specter/TextView.hpp"
|
||||
#include "specter/ViewResources.hpp"
|
||||
#include "utf8proc.h"
|
||||
#include "athena/utf8proc.h"
|
||||
#include "hecl/Pipeline.hpp"
|
||||
|
||||
#include <boo/graphicsdev/IGraphicsCommandQueue.hpp>
|
||||
|
|
Loading…
Reference in New Issue