-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
81 lines (73 loc) · 2.5 KB
/
CMakeLists.txt
File metadata and controls
81 lines (73 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
cmake_minimum_required(VERSION 3.22)
project(DevPlugins)
# this is always be true
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
# msvc utf-8 strings
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
# simde
add_library(simde INTERFACE)
target_include_directories(simde INTERFACE simde-no-tests)
# complier option for dynamic simd dispatch
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
if (MSVC)
message(STATUS FATAL_ERROR "msvc on macos?")
else()
set(PLUGIN_VEC4_COMPLIER_OPTION -march=native)
set(PLUGIN_VEC4_LESS_COMPLIER_OPTION -march=native)
set(PLUGIN_VEC8_COMPLIER_OPTION -march=native)
set(PLUGIN_VEC8_LESS_COMPLIER_OPTION -march=native)
add_compile_definitions(PLUGIN_VEC4_DISPATCH_ISET=NEON)
add_compile_definitions(PLUGIN_VEC4_LESS_DISPATCH_ISET=NEON)
add_compile_definitions(PLUGIN_VEC8_DISPATCH_ISET=NEON)
add_compile_definitions(PLUGIN_VEC8_LESS_DISPATCH_ISET=NEON)
endif()
else()
if (MSVC)
set(PLUGIN_VEC4_COMPLIER_OPTION /arch:SSE4.2)
set(PLUGIN_VEC4_LESS_COMPLIER_OPTION /arch:SSE2)
set(PLUGIN_VEC8_COMPLIER_OPTION /arch:avx2)
set(PLUGIN_VEC8_LESS_COMPLIER_OPTION /arch:avx)
else()
set(PLUGIN_VEC4_COMPLIER_OPTION -msse4.1)
set(PLUGIN_VEC4_LESS_COMPLIER_OPTION -msse4.1)
set(PLUGIN_VEC8_COMPLIER_OPTION -mavx2)
set(PLUGIN_VEC8_LESS_COMPLIER_OPTION -mavx)
endif()
# basic sse support
add_compile_definitions(PLUGIN_VEC4_LESS_DISPATCH_ISET=SSE2)
# most sse support
add_compile_definitions(PLUGIN_VEC4_DISPATCH_ISET=SSE4_1)
# most avx2 support
add_compile_definitions(PLUGIN_VEC8_DISPATCH_ISET=AVX2)
# if a plugin don't use avx2 intergal instruction, use this
add_compile_definitions(PLUGIN_VEC8_LESS_DISPATCH_ISET=AVX)
endif()
# floating point optimise
if (MSVC)
add_compile_options(
/fp:fast # msvc won't delete std::isnan std::isinf
)
else()
add_compile_options(
-ffast-math
-fno-finite-math-only
)
endif()
# folders
add_subdirectory(cpp_simd_detector)
add_subdirectory(json)
add_subdirectory(eigen)
add_subdirectory(JUCE)
if(NOT DEFINED CI_PLUGIN_BUILD)
add_subdirectory(raylib)
endif()
# add_subdirectory(Catch2)
add_subdirectory(qwqdsp)
add_subdirectory(plugins)
if(EXISTS get_cmake_target_info.cmake)
include(get_cmake_target_info.cmake)
endif()
if(DEFINED CI_PLUGIN_BUILD)
message("[DEBUG] does github action get here???")
endif()