Skip to content

Instantly share code, notes, and snippets.

@nhtranngoc
Created June 13, 2020 21:36
Show Gist options
  • Save nhtranngoc/d2319b409cbcf431bda9e1f2d9a53ecb to your computer and use it in GitHub Desktop.
Save nhtranngoc/d2319b409cbcf431bda9e1f2d9a53ecb to your computer and use it in GitHub Desktop.
Yart's main CMakeLists
cmake_minimum_required(VERSION 3.10)
project(yart)
enable_language(C CXX)
if(CMAKE_CROSSCOMPILING)
message(STATUS "Crosscompiling enabled, using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
add_subdirectory(src)
else()
message(STATUS "No crosscompiling specified, compiling in /tests only.")
add_subdirectory(tests)
endif()
set(COMMON_C_FLAGS "-lc -lgcc -Os -g \
-Wall -Werror -Wredundant-decls -Wstrict-prototypes \
-fsingle-precision-constant -Wdouble-promotion -Wfloat-conversion \
-fno-common -ffunction-sections -fdata-sections -MD -Wundef")
set(COMMON_CXX_FLAGS "-lc -lgcc -Os -Wall -Werror -std=c++11 \
-fsingle-precision-constant -Wdouble-promotion -Wfloat-conversion")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment