-
Notifications
You must be signed in to change notification settings - Fork 329
Expand file tree
/
Copy pathbase.cmake
More file actions
32 lines (28 loc) · 1.39 KB
/
Copy pathbase.cmake
File metadata and controls
32 lines (28 loc) · 1.39 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
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/components")
macro(rg_setup_compile_options)
component_compile_options(
-D${RG_BUILD_TARGET}=1
-DRETRO_GO=1
-fjump-tables -ftree-switch-conversion
${ARGV}
)
# The PSRAM cache bug is responsible for many subtile bugs and crashes. The workaround has a
# significant performance impact but the alternative is instability... Enabling the fix here
# instead of sdkconfig prevents the new libc and wifi from being linked in which increases
# size and reduces performance further. It's not entirely safe but retro-go has been built
# with the workaround fully disabled for years, so clearly this compromise should be "fine".
# memw seems to have the least impact both in terms of size and performance
if(IDF_TARGET STREQUAL "esp32")
component_compile_options(-mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw)
endif()
if(RG_ENABLE_NETPLAY)
component_compile_options(-DRG_ENABLE_NETWORKING -DRG_ENABLE_NETPLAY)
elseif(RG_ENABLE_NETWORKING)
component_compile_options(-DRG_ENABLE_NETWORKING)
endif()
if(RG_ENABLE_PROFILING)
# Still debating whether -fno-inline is necessary or not...
component_compile_options(-DRG_ENABLE_PROFILING -finstrument-functions)
endif()
endmacro()