nostalgia/CMakeLists.txt

50 lines
995 B
CMake
Raw Normal View History

2016-03-26 15:49:05 -05:00
cmake_minimum_required(VERSION 2.8.8)
project(nostalgia)
2016-03-26 15:49:05 -05:00
set(NOSTALGIA_BUILD_TYPE "Native" CACHE STRING "The type of build to produce(Native/GBA)")
set(NOSTALGIA_IDE_BUILD "ON" CACHE STRING "Build for IDE's to run")
2016-03-26 15:49:05 -05:00
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
include(address_sanitizer)
2016-12-23 17:29:19 -06:00
if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA")
2016-12-23 17:29:19 -06:00
include(GBA)
add_definitions(
-nostdlib
-fno-exceptions
-fno-rtti
)
2016-12-23 17:29:19 -06:00
endif()
2016-03-26 15:49:05 -05:00
add_definitions(
2016-12-23 17:29:19 -06:00
-std=c++11
2016-03-26 15:49:05 -05:00
-Wall
-Wsign-compare
)
if(NOSTALGIA_IDE_BUILD STREQUAL "ON")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
2017-10-17 19:16:22 -05:00
if (APPLE)
set(CMAKE_MACOSX_RPATH ON)
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN" "$ORIGIN/../lib/nostalgia")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()
2016-12-24 13:06:44 -06:00
if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(
-Werror
)
endif()
2016-03-26 15:49:05 -05:00
enable_testing()
add_subdirectory(deps/ox)
include_directories(deps/ox/src)
2016-03-26 15:49:05 -05:00
add_subdirectory(src)