Skip to content

Commit

Permalink
build: add stb_rect_pack 1.01 (MIT or public domain)
Browse files Browse the repository at this point in the history
  • Loading branch information
carstene1ns committed Sep 25, 2024
1 parent 58ba9a3 commit e66a2c7
Show file tree
Hide file tree
Showing 7 changed files with 703 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ set_property(SOURCE src/main.cpp PROPERTY COMPILE_DEFINITIONS
OJ_URL="${PROJECT_HOMEPAGE_URL}"; OJ_BUGREPORT="${OJ_BUGREPORT}")

target_link_libraries(OpenJazz
argparse miniz psmplug ${OJ_LIBS_SCALE} ${OJ_LIBS_SDL} ${OJ_LIBS_NET} ${OJ_LIBS_HOST})
argparse miniz psmplug stb
${OJ_LIBS_SCALE} ${OJ_LIBS_SDL} ${OJ_LIBS_NET} ${OJ_LIBS_HOST})

# platform stuff

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
CXX ?= g++ -std=c++14
CXXFLAGS ?= -g -Wall -O2
DEFINES = -DSCALE -DPORTABLE
CPPFLAGS = $(DEFINES) -Isrc -Iext/scale2x -Iext/psmplug -Iext/miniz -Iext/argparse
CPPFLAGS = $(DEFINES) -Isrc -Iext/scale2x -Iext/psmplug -Iext/miniz -Iext/argparse -Iext/stb

# Network support
CXXFLAGS += -DUSE_SOCKETS
Expand All @@ -24,6 +24,7 @@ LIBS += -lm
OJEXTLIBOBJ = \
ext/argparse/argparse.o \
ext/miniz/miniz.o \
ext/stb/stb_rect_pack.o \
ext/psmplug/fastmix.o \
ext/psmplug/load_psm.o \
ext/psmplug/psmplug.o \
Expand Down
13 changes: 9 additions & 4 deletions ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# argparse

add_library(argparse STATIC argparse/argparse.h argparse/argparse.cpp)
target_include_directories(argparse PUBLIC argparse)
target_include_directories(argparse INTERFACE argparse)

# miniz

add_library(miniz STATIC miniz/miniz.h miniz/miniz.cpp)
target_compile_definitions(miniz PUBLIC MINIZ_NO_ARCHIVE_APIS)
target_compile_definitions(miniz INTERFACE MINIZ_NO_ARCHIVE_APIS)
#target_compile_definitions(miniz PRIVATE _LARGEFILE64_SOURCE)
target_include_directories(miniz PUBLIC miniz)
target_include_directories(miniz INTERFACE miniz)

# psmplug

Expand All @@ -27,4 +27,9 @@ add_library(psmplug STATIC
psmplug/stdafx.h
psmplug/tables.h
)
target_include_directories(psmplug PUBLIC psmplug)
target_include_directories(psmplug INTERFACE psmplug)

# stb

add_library(stb STATIC stb/stb_rect_pack.h stb/stb_rect_pack.cpp)
target_include_directories(stb INTERFACE stb)
37 changes: 37 additions & 0 deletions ext/stb/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Sean Barrett
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 2 additions & 0 deletions ext/stb/stb_rect_pack.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define STB_RECT_PACK_IMPLEMENTATION
#include "stb_rect_pack.h"
Loading

0 comments on commit e66a2c7

Please sign in to comment.