-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4463373
commit 4286522
Showing
13 changed files
with
386 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
imzero_video_play | ||
build | ||
cmake-build-* | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# generated using cmakelists.dhall | ||
cmake_minimum_required(VERSION 3.24) | ||
project(mzero_video_play) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_LINKER clang++) | ||
set(CMAKE_CXX_COMPILER clang++) | ||
|
||
add_compile_definitions() | ||
include_directories("${CMAKE_CURRENT_LIST_DIR}/./contrib/sdl3/include" | ||
"${CMAKE_CURRENT_LIST_DIR}/./contrib/tracy/public") | ||
set(COMPILE_OPTIONS -std=c++20 | ||
-fno-exceptions | ||
-O3) | ||
link_libraries(-DNDEBUG | ||
-lmpv) | ||
|
||
|
||
add_library(render OBJECT "${CMAKE_CURRENT_LIST_DIR}/./sdl2_mpv/main.cpp") | ||
|
||
add_library(mpv_imported OBJECT IMPORTED) | ||
set_property(TARGET mpv_imported PROPERTY IMPORTED_OBJECTS "${CMAKE_CURRENT_LIST_DIR}/./contrib/sdl3/build/libSDL3.a") | ||
|
||
add_library(tracyDisabled OBJECT "${CMAKE_CURRENT_LIST_DIR}/./contrib/tracy/public/TracyClient.cpp") | ||
add_executable(imzero_video_play $<TARGET_OBJECTS:render> | ||
$<TARGET_OBJECTS:mpv_imported> | ||
$<TARGET_OBJECTS:tracyDisabled>) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
set -ev | ||
here=$(dirname "$(readlink -f "$BASH_SOURCE")") | ||
cd "$here" | ||
source "env.sh" | ||
./build_cpp.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -ev | ||
here=$(dirname "$(readlink -f "$BASH_SOURCE")") | ||
cd "$here" | ||
|
||
./cmakelists.dhall | ||
|
||
generate_buildinfo() { | ||
echo -en "#pragma once\nnamespace buildinfo {\n static const char *gitCommit=\"" | ||
git log -1 --pretty=format:"%H" | tr -d "\n" | ||
echo -en "\";\n static const bool gitDirty=" | ||
if [[ $(git diff --stat) != '' ]]; then | ||
echo -n "true" | ||
else | ||
echo -n "false" | ||
fi | ||
echo -en ";\n}\n" | ||
} | ||
generate_buildinfo > src/buildinfo.gen.h | ||
|
||
mkdir -p build | ||
cd build | ||
cmake ../CMakeLists.txt | ||
cmake --build . -j | ||
mv imzero_video_play .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env -S dhall text --output CMakeLists.txt --file | ||
let prelude = ../dhall/prelude.dhall | ||
let lib = ../dhall/lib.dhall | ||
let cmake = ../dhall/cmakelists.dhall | ||
let sourceTreePartsRepo = ../dhall/sourceTreeParts.dhall | ||
let common = ./common.dhall | ||
in | ||
cmake.cmakelistsToText cmake.cmakelists::{ | ||
, cxx = common.cxx | ||
, linker = common.linker | ||
, exe = "imzero_video_play" | ||
, projectName = "mzero_video_play" | ||
, cxxflags = ["-std=c++${Natural/show common.cppstd}" ] # common.cxxflags # common.stdlibFlags | ||
, ldflags = common.ldflags # common.stdlibFlags | ||
, sourceTreeParts = common.sourceTreeParts | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
let lib = ../dhall/lib.dhall | ||
let debug = False | ||
let asan = False | ||
--let clangdir = env:CLANGDIR as Text -- FIXME sync with ./build_skia_asan.sh | ||
let sourceTreePartsRepo = ../dhall/sourceTreeParts.dhall | ||
let sourceTreeParts = [ | ||
, sourceTreePartsRepo.sdl3 | ||
, sourceTreePartsRepo.sdl2mpv | ||
, sourceTreePartsRepo.mpv | ||
] # (if debug then [ , sourceTreePartsRepo.tracyEnabled ] else [ ,sourceTreePartsRepo.tracyDisabled ] : List lib.sourceTreePart.Type ) | ||
--let cxx = "${clangdir}/bin/clang++" | ||
let cxx = "clang++" | ||
let cppstd = 20 | ||
let cxxflags = ["-fno-exceptions"] | ||
let cxxflagsDebug = [ | ||
, "-g" | ||
, "-gdwarf-4" | ||
, "-Wall" | ||
, "-Wformat" | ||
, "-Wextra" | ||
, "-O1" | ||
] # (if asan then [ "-fsanitize=address", "-fsanitize=undefined" ] else [] : List Text) # | ||
[, "-fno-omit-frame-pointer" | ||
, "-DIMZERO_DEBUG_BUILD" | ||
--, "-fno-optimize-sibling-calls" -- no tail calls for better stacktraces | ||
] | ||
let cxxflagsRelease = [ | ||
, "-O3" | ||
] | ||
let ldflagsDebug = if asan then [ | ||
, "-fsanitize=address" | ||
, "-fsanitize=undefined" | ||
, "-fuse-ld=lld" | ||
, "-v" | ||
-- , "-Wl,-rpath,${clangdir}/lib/x86_64-unknown-linux-gnu" | ||
] else [] : List Text | ||
let ldflagsRelease = ["-DNDEBUG"] : List Text | ||
--let stdlibFlags = ["-stdlib=libc++"] : List Text | ||
let stdlibFlags = [] : List Text | ||
let linker = cxx | ||
in { | ||
, sourceTreeParts | ||
, cxx | ||
, linker | ||
, cppstd | ||
, cxxflags = cxxflags # (if debug then cxxflagsDebug else cxxflagsRelease) | ||
, ldflags = if debug then ldflagsDebug else ldflagsRelease | ||
, stdlibFlags | ||
, debug | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../common/contrib/sdl3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../common/contrib/tracy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export PKG_CONFIG_OUTPUT_CFLAGS_FREETYPE2="" | ||
export PKG_CONFIG_OUTPUT_LIBS_FREETYPE2="" | ||
export PKG_CONFIG_OUTPUT_CFLAGS_GLFW3="" | ||
export PKG_CONFIG_OUTPUT_LIBS_GLFW3="" | ||
export CLANGDIR="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
here=$(dirname "$(readlink -f "$BASH_SOURCE")") | ||
cd "$here" | ||
source "../common/lib.sh" | ||
|
||
link ../common/contrib/sdl3 contrib/sdl3 | ||
link ../common/contrib/tracy contrib/tracy |
Oops, something went wrong.