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
Showing
51 changed files
with
341 additions
and
422 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: 1.0.5{build} | ||
|
||
clone_depth: 5 | ||
|
||
build: | ||
parallel: true | ||
verbosity: minimal | ||
|
||
environment: | ||
matrix: | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | ||
ARCHITECTURE: x64 | ||
GEN: "Visual Studio 15 2017 Win64" | ||
CFG: Debug | ||
BUILD_OUT: "x64-Debug" | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | ||
ARCHITECTURE: x64 | ||
GEN: "Visual Studio 15 2017 Win64" | ||
CFG: Release | ||
BUILD_OUT: "x64-Release" | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | ||
ARCHITECTURE: x86 | ||
GEN: "Visual Studio 15 2017" | ||
CFG: Debug | ||
BUILD_OUT: "x86-Debug" | ||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 | ||
ARCHITECTURE: x86 | ||
GEN: "Visual Studio 15 2017" | ||
CFG: Release | ||
BUILD_OUT: "x86-Release" | ||
NINJA_URL: https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip | ||
MSVC_HOME: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community" | ||
|
||
install: | ||
- git submodule update --init --recursive | ||
# Get Ninja | ||
- appveyor DownloadFile %NINJA_URL% -FileName ninja.zip | ||
- 7z x ninja.zip -oC:\ninja > nul | ||
- set PATH=C:\ninja;%PATH% | ||
- ninja --version | ||
|
||
build_script: | ||
- call "%MSVC_HOME%\VC\Auxiliary\Build\vcvarsall.bat" %ARCHITECTURE% | ||
- mkdir bin\%BUILD_OUT% && cd bin\%BUILD_OUT% | ||
- cmake -DCMAKE_BUILD_TYPE=%CFG% -GNinja ../../ | ||
- ninja |
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,3 @@ | ||
.vs/* | ||
out/* | ||
.DS_Store |
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,76 @@ | ||
matrix: | ||
include: | ||
# GCC 7 | ||
- os: linux | ||
dist: xenial | ||
sudo: required | ||
addons: &gcc7 | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- pkg-config | ||
- cmake | ||
- g++-7 | ||
language: cpp | ||
compiler: gcc | ||
env: | ||
- COMPILER=g++-7 | ||
- GSL_CXX_STANDARD=17 | ||
- BUILD_TYPE=Release | ||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90 | ||
# Clang 6.0 | ||
- os: linux | ||
dist: xenial | ||
sudo: required | ||
addons: &clang60 | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-xenial-6.0 | ||
- sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main' | ||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' | ||
packages: | ||
- pkg-config | ||
- cmake | ||
- clang-6.0 | ||
- g++-7 | ||
language: cpp | ||
compiler: clang | ||
env: | ||
- COMPILER=clang++-6.0 | ||
- GSL_CXX_STANDARD=17 | ||
- BUILD_TYPE=Release | ||
before_install: | ||
- sudo apt-get update -qq | ||
- sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 1000 | ||
- sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 1000 | ||
- clang --version | ||
# XCode 10.2 | ||
- os: osx | ||
osx_image: xcode10.2 | ||
sudo: required | ||
language: cpp | ||
compiler: clang | ||
env: | ||
- COMPILER=clang++ | ||
- GSL_CXX_STANDARD=17 | ||
- BUILD_TYPE=Release | ||
before_install: | ||
- brew update | ||
- brew install pkg-config | ||
|
||
script: | ||
- git submodule update --init --recursive | ||
- mkdir bin && cd bin | ||
- | | ||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE | ||
make all -j$(nproc) | ||
else | ||
cmake .. -G "Xcode" -DCMAKE_BUILD_TYPE=$BUILD_TYPE | ||
xcodebuild -quiet -parallelizeTargets -jobs $(sysctl -n hw.physicalcpu) -target basisu -configuration $BUILD_TYPE | ||
fi | ||
- cd ../ |
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 |
---|---|---|
@@ -1,87 +1,21 @@ | ||
project(basisu) | ||
cmake_minimum_required(VERSION 3.0 FATAL_ERROR) | ||
project(basisu VERSION 1.0.5 LANGUAGES C CXX) | ||
|
||
cmake_minimum_required(VERSION 3.0) | ||
option(BUILD_X64 "build 64-bit" TRUE) | ||
option(STATIC "static linking" FALSE) | ||
option(BUILD_SHARED_LIBS "Build Shared Libraries" ON) | ||
option(BASISU_BUILD_TOOL "Build the tool" ON) | ||
option(BASISU_INSTALL "Installs basis universal" ON) | ||
option(BASISU_INSTALL_TOOL "Installs the tool" ON) | ||
|
||
message("Initial BUILD_X64=${BUILD_X64}") | ||
message("Initial CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") | ||
# GNU filesystem conventions | ||
include(GNUInstallDirs) | ||
|
||
if( NOT CMAKE_BUILD_TYPE ) | ||
set( CMAKE_BUILD_TYPE Release ) | ||
endif( NOT CMAKE_BUILD_TYPE ) | ||
# Windows build shared libraries | ||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||
|
||
message( ${PROJECT_NAME} " build type: " ${CMAKE_BUILD_TYPE} ) | ||
find_package(Threads REQUIRED) | ||
|
||
if (BUILD_X64) | ||
message("Building 64-bit") | ||
else() | ||
message("Building 32-bit") | ||
endif(BUILD_X64) | ||
add_subdirectory(basisu) | ||
|
||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") | ||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") | ||
|
||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") | ||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") | ||
|
||
set(CMAKE_CXX_FLAGS -std=c++11) | ||
set(GCC_COMPILE_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden -fPIC -fopenmp -fno-strict-aliasing -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -Wextra -Wno-unused-local-typedefs -Wno-unused-value -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-unused-variable -Wno-reorder") | ||
|
||
if (NOT BUILD_X64) | ||
set(GCC_COMPILE_FLAGS "${GCC_COMPILE_FLAGS} -m32") | ||
if(BASISU_BUILD_TOOL) | ||
add_subdirectory(tool) | ||
endif() | ||
|
||
if (STATIC) | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS} -static-libgcc -static-libstdc++ -static") | ||
else() | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINK_FLAGS} -Wl,-rpath .") | ||
endif(STATIC) | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCC_COMPILE_FLAGS}") | ||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${GCC_COMPILE_FLAGS}") | ||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${GCC_COMPILE_FLAGS} -D_DEBUG") | ||
|
||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COMPILE_FLAGS}") | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${GCC_COMPILE_FLAGS}") | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${GCC_COMPILE_FLAGS} -D_DEBUG") | ||
|
||
set(BASISU_SRC_LIST ${COMMON_SRC_LIST} | ||
basisu_backend.cpp | ||
basisu_basis_file.cpp | ||
basisu_comp.cpp | ||
basisu_enc.cpp | ||
basisu_etc.cpp | ||
basisu_frontend.cpp | ||
basisu_global_selector_palette_helpers.cpp | ||
basisu_gpu_texture.cpp | ||
basisu_pvrtc1_4.cpp | ||
basisu_resampler.cpp | ||
basisu_resample_filters.cpp | ||
basisu_ssim.cpp | ||
basisu_tool.cpp | ||
lodepng.cpp | ||
transcoder/basisu_transcoder.cpp | ||
) | ||
|
||
if (APPLE) | ||
set(BIN_DIRECTORY "bin_osx") | ||
else() | ||
set(BIN_DIRECTORY "bin") | ||
endif() | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/${BIN_DIRECTORY}) | ||
|
||
add_executable(basisu ${BASISU_SRC_LIST}) | ||
target_link_libraries(basisu m pthread) | ||
|
||
install(TARGETS basisu DESTINATION bin) | ||
|
||
if (CMAKE_BUILD_TYPE STREQUAL Release) | ||
if (APPLE) | ||
add_custom_command(TARGET basisu POST_BUILD COMMAND strip -X -x ${CMAKE_SOURCE_DIR}/${BIN_DIRECTORY}/basisu) | ||
else() | ||
add_custom_command(TARGET basisu POST_BUILD COMMAND strip -g -X -x ${CMAKE_SOURCE_DIR}/${BIN_DIRECTORY}/basisu) | ||
endif() | ||
endif() | ||
|
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.