forked from ducalex/retro-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
base.cmake
36 lines (31 loc) · 1.24 KB
/
base.cmake
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
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/components")
if (DEFINED "RG_TARGET_ESPLAY_S3")
message("SDKCONFIG_DEFAULTS: ${CMAKE_CURRENT_LIST_DIR}/baseS3.sdkconfig")
set(SDKCONFIG_DEFAULTS "${CMAKE_CURRENT_LIST_DIR}/baseS3.sdkconfig")
else()
message("SDKCONFIG_DEFAULTS: ${CMAKE_CURRENT_LIST_DIR}/base.sdkconfig")
set(SDKCONFIG_DEFAULTS "${CMAKE_CURRENT_LIST_DIR}/base.sdkconfig")
endif ()
macro(rg_setup_compile_options)
set(RG_TARGET "RG_TARGET_$ENV{RG_BUILD_TARGET}")
message("Target: ${RG_TARGET}")
component_compile_options(
-D${RG_TARGET}
-DRETRO_GO
${ARGV}
)
if(NOT ";${ARGV};" MATCHES ";-O[0123gs];")
# Only default to -O3 if not specified by the app
component_compile_options(-O3)
endif()
if($ENV{RG_ENABLE_NETPLAY})
component_compile_options(-DRG_ENABLE_NETWORKING -DRG_ENABLE_NETPLAY)
elseif($ENV{RG_ENABLE_NETWORKING})
component_compile_options(-DRG_ENABLE_NETWORKING)
endif()
if($ENV{RG_ENABLE_PROFILING})
# Still debating whether -fno-inline is necessary or not...
component_compile_options(-DRG_ENABLE_PROFILING -finstrument-functions)
endif()
endmacro()