@@ -4,8 +4,10 @@ set(CMAKE_CXX_STANDARD 20)
44set (CMAKE_C_STANDARD 17)
55
66set (PROJECT mv)
7- option (BUILD_ID "what to build for: apple or pico" "apple" )
8- if (BUILD_ID STREQUAL "apple" )
7+
8+ set (BUILDFOR "apple" CACHE STRING "what to build for: apple or pico" )
9+
10+ if (BUILDFOR STREQUAL "apple" OR BUILDFOR STREQUAL "linux" )
911 # PROJECT_VERSION_MAJOR year
1012 # PROJECT_VERSION_MINOR month
1113 # PROJECT_VERSION_PATCH day
@@ -16,7 +18,7 @@ if (BUILD_ID STREQUAL "apple")
1618 find_package (Threads REQUIRED )
1719 string (PREPEND CMAKE_EXE_LINKER_FLAGS " -Wl " )
1820 set (PROJECT_TARGET_PLATFORM "Unix" )
19- elseif (BUILD_ID STREQUAL "pico" )
21+ elseif (BUILDFOR STREQUAL "pico" )
2022 set (PICO_BOARD pico) # pico or pico_w or pico2
2123 set (PICO_SDK_PATH "$ENV{HOME} /github/pico-sdk" )
2224 set (ENV{PATH } "$ENV{HOME} /github/gcc-arm/bin:$ENV{PATH} " )
@@ -33,6 +35,8 @@ elseif(BUILD_ID STREQUAL "pico")
3335
3436 string (PREPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--print-memory-usage " )
3537 set (PROJECT_TARGET_PLATFORM "Pi Pico" )
38+ else ()
39+ message (FATAL_ERROR "No BUILDFOR given" )
3640endif ()
3741
3842string (APPEND CMAKE_CXX_FLAGS_RELEASE " -O3 " )
@@ -85,7 +89,7 @@ if(${BUILD_EXAMPLES})
8589endif ()
8690
8791# Tests --------------------------------------------------------------
88- if (${BUILD_GTESTS} )
89- message (STATUS "building unix tests" )
90- add_subdirectory (test )
91- endif ()
92+ # if(${BUILD_GTESTS})
93+ # message(STATUS "building unix tests")
94+ # add_subdirectory(test)
95+ # endif()
0 commit comments