Skip to content

Commit fb2cb80

Browse files
committed
.cube file loading, .smcube file loading/saving
1 parent 3709ab4 commit fb2cb80

13 files changed

+575
-791
lines changed

CMakeLists.txt

+2-59
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,23 @@ cmake_minimum_required (VERSION 3.21)
22
if(POLICY CMP0091)
33
cmake_policy(SET CMP0091 NEW) # enable MSVC_RUNTIME_LIBRARY
44
endif()
5-
if(POLICY CMP0077)
6-
cmake_policy(SET CMP0077 NEW) # enable override of options from parent CMakeLists.txt
7-
endif()
8-
if(POLICY CMP0135)
9-
cmake_policy(SET CMP0135 NEW) # avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24+
10-
endif()
11-
if(POLICY CMP0092)
12-
cmake_policy(SET CMP0092 NEW) # enables /W4 override for MSVC
13-
endif()
14-
15-
include(FetchContent)
16-
17-
# zstd
18-
FetchContent_Declare(
19-
zstd
20-
URL https://github.com/facebook/zstd/archive/refs/tags/v1.5.6.zip # latest (2024 Mar) at time of writing
21-
SOURCE_SUBDIR build/cmake
22-
)
23-
set(ZSTD_LEGACY_SUPPORT OFF)
24-
set(ZSTD_MULTITHREAD_SUPPORT OFF)
25-
set(ZSTD_BUILD_TESTS OFF)
26-
set(ZSTD_BUILD_PROGRAMS OFF)
27-
set(ZSTD_BUILD_CONTRIB OFF)
28-
set(ZSTD_BUILD_STATIC ON)
29-
set(ZSTD_BUILD_SHARED OFF)
30-
FetchContent_MakeAvailable(zstd)
315

326
project ("smol-cube")
337

348
add_executable (smol-cube
359
src/main.cpp
36-
src/compression_helpers.cpp
37-
src/compression_helpers.h
38-
39-
src/filters.cpp
40-
src/filters.h
41-
src/simd.h
4210
src/smol_cube.cpp
4311
src/smol_cube.h
44-
src/systeminfo.cpp
45-
src/systeminfo.h
46-
4712
CMakeLists.txt
4813
CMakePresets.json
4914
)
50-
set_property(TARGET smol-cube PROPERTY CXX_STANDARD 20)
15+
set_property(TARGET smol-cube PROPERTY CXX_STANDARD 17)
16+
set_property(TARGET smol-cube PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
5117

5218
target_include_directories(smol-cube PRIVATE
53-
${zstd_SOURCE_DIR}/lib
5419
)
5520

5621
target_link_libraries(smol-cube PRIVATE
57-
libzstd_static
5822
)
5923

6024
target_compile_definitions(smol-cube PRIVATE
@@ -66,24 +30,3 @@ target_compile_definitions(smol-cube PRIVATE
6630
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64"))
6731
target_compile_options(smol-cube PRIVATE -msse4.1)
6832
endif()
69-
70-
71-
# Enable debug symbols (RelWithDebInfo is not only that; it also turns on
72-
# incremental linking, disables some inlining, etc. etc.)
73-
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")
74-
set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP "NO")
75-
set(CMAKE_XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT "NO")
76-
77-
# note: this does not work; have to pass -g instead
78-
#set(CMAKE_XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES")
79-
80-
if (CMAKE_BUILD_TYPE STREQUAL "Release")
81-
if (MSVC)
82-
target_compile_options(smol-cube PRIVATE /Zi)
83-
target_link_options(smol-cube PRIVATE /DEBUG /OPT:ICF /OPT:REF)
84-
endif()
85-
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
86-
target_compile_options(smol-cube PRIVATE -g)
87-
target_link_options(smol-cube PRIVATE -g)
88-
endif()
89-
endif ()

CMakePresets.json

+6-16
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
},
3636
"cacheVariables": {
3737
"CMAKE_OSX_DEPLOYMENT_TARGET": "10.14"
38-
}
39-
},
38+
}
39+
},
4040
{
4141
"name": "x64-debug",
4242
"displayName": "x64 Debug",
@@ -58,21 +58,11 @@
5858
}
5959
},
6060
{
61-
"name": "x64-debug-cl",
62-
"displayName": "x64 Debug clang",
61+
"name": "x64-release-dbg",
62+
"displayName": "x64 RelWithDebInfo",
6363
"inherits": "x64-debug",
6464
"cacheVariables": {
65-
"CMAKE_C_COMPILER": "clang-cl",
66-
"CMAKE_CXX_COMPILER": "clang-cl"
67-
}
68-
},
69-
{
70-
"name": "x64-release-cl",
71-
"displayName": "x64 Release clang",
72-
"inherits": "x64-release",
73-
"cacheVariables": {
74-
"CMAKE_C_COMPILER": "clang-cl",
75-
"CMAKE_CXX_COMPILER": "clang-cl"
65+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
7666
}
7767
},
7868
{
@@ -90,6 +80,6 @@
9080
"cacheVariables": {
9181
"CMAKE_BUILD_TYPE": "Release"
9282
}
93-
}
83+
}
9484
]
9585
}

launch.vs.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.2.1",
3+
"defaults": {},
4+
"configurations": [
5+
{
6+
"type": "default",
7+
"project": "CMakeLists.txt",
8+
"projectTarget": "smol-cube.exe",
9+
"name": "smol-cube.exe",
10+
"currentDir": "${workspaceRoot}",
11+
"args": [
12+
"--verbose",
13+
"--roundtrip",
14+
"tests/luts/synthetic/shaper_3d.cube",
15+
"\"tests/luts/davinci/LMT ACES v0.1.1.cube\""
16+
]
17+
}
18+
]
19+
}

src/compression_helpers.cpp

-58
This file was deleted.

src/compression_helpers.h

-18
This file was deleted.

src/filters.cpp

-107
This file was deleted.

src/filters.h

-7
This file was deleted.

0 commit comments

Comments
 (0)