nanowasm/CMakeLists.txt

28 lines
810 B
CMake

cmake_minimum_required(VERSION 3.13)
project(nanowasm C)
option(NW_LOG "Enables logging to stderr" ON)
add_library(${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} PUBLIC include
PRIVATE private_include)
target_compile_options(${PROJECT_NAME} PRIVATE
-ffunction-sections
-fdata-sections
-pedantic
-Wall
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(${PROJECT_NAME} PRIVATE -Og)
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(${PROJECT_NAME} PRIVATE -Os)
endif()
if(NW_LOG)
target_compile_definitions(${PROJECT_NAME} PRIVATE ENABLE_LOG)
endif()
target_compile_features(${PROJECT_NAME} PUBLIC c_std_99)
set_target_properties(${PROJECT_NAME} PROPERTIES C_STANDARD 99 C_EXTENSIONS OFF)
add_subdirectory(src)
add_subdirectory(test)