@@ -2,59 +2,23 @@ cmake_minimum_required (VERSION 3.21)
2
2
if (POLICY CMP0091)
3
3
cmake_policy (SET CMP0091 NEW) # enable MSVC_RUNTIME_LIBRARY
4
4
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)
31
5
32
6
project ("smol-cube" )
33
7
34
8
add_executable (smol-cube
35
9
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
42
10
src/smol_cube.cpp
43
11
src/smol_cube.h
44
- src/systeminfo.cpp
45
- src/systeminfo.h
46
-
47
12
CMakeLists.txt
48
13
CMakePresets.json
49
14
)
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>" )
51
17
52
18
target_include_directories (smol-cube PRIVATE
53
- ${zstd_SOURCE_DIR} /lib
54
19
)
55
20
56
21
target_link_libraries (smol-cube PRIVATE
57
- libzstd_static
58
22
)
59
23
60
24
target_compile_definitions (smol-cube PRIVATE
@@ -66,24 +30,3 @@ target_compile_definitions(smol-cube PRIVATE
66
30
if ((CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" ))
67
31
target_compile_options (smol-cube PRIVATE -msse4.1)
68
32
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 ()
0 commit comments