jasper/deps/ox/CMakeLists.txt
Gary Talent 22e6299e90 Squashed 'deps/nostalgia/' changes from 84205879..0c0ccd1a
0c0ccd1a [nostalgia/core/studio] Cleanup scratchpad code
1b629da8 [ox/std] Make Vector::contains always noexcept
32e4702d [ox] Improve hasing and MaybeView
6b47133c [nostalgia] Cleanup StudioModules
0764720f [nostalgia,olympic] Update for Ox changes
78955376 [glutils] Update for Ox changes
a00a0bd2 [ox] Rename BString to IString
ed4f0e1f [nostalgia,olympic] Replace oxIgnoreError with std::ignore
ea1feb72 [ox] Remove oxIgnoreError
e9a6a096 [ox] Run liccor
d7f30975 Merge commit 'c0baf7efca0e4c3a86a018ad2564d9df7b07c133'
eeb2a5a1 [olympic/studio] Add new ImGui util functions
453f2750 [nostalgia/core/studio] Cleanup context types
189ba4c5 [olympic/studio] Make studio::run static
05773808 [olympic] Change TypeId building to use constexpr globals
272eabc7 [nostalgia/core/opengl] Unbind vertex arrays when done with them
a0256669 [glutils] Remove trailing whitespace
6808adc8 [ox/std] Replace ox::ignore with std::ignore
abc076d6 [ox/std] Cleanup
1b790a34 [ox/std] Fix Signed_c and Unsigned_c
92202716 [nostalgia/core] Update pack transforms to use ModelTypeId_v
7941a514 [ox/model] Add constexpr ModelTypeId_v
0c09c530 [ox/std] Fix sfmt constexpr problems
3ff91af8 [ox/std] Sort of fix custom assert
79b42e1d [ox/std] Fix some Vector constexpr problems
5eec9085 [ox/std] Add nodiscard to some string functions
af7c8956 [ox/std] Add ox::ignore

git-subtree-dir: deps/nostalgia
git-subtree-split: 0c0ccd1a692169d99beb8c238b8b2c466e81a13d
2024-04-24 23:10:33 -05:00

87 lines
2.6 KiB
CMake

cmake_minimum_required(VERSION 3.19)
set(CMAKE_POLICY_DEFAULT_CMP0110 NEW) # requires CMake 3.19
project(Ox CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
include(address_sanitizer)
if(NOT DEFINED OX_RUN_TESTS)
set(OX_RUN_TESTS ON)
endif()
if(NOT DEFINED OX_BUILD_EXEC)
set(OX_BUILD_EXEC ON)
endif()
if(NOT DEFINED OX_USE_STDLIB)
set(OX_USE_STDLIB ON)
endif()
if(NOT DEFINED OX_BARE_METAL)
set(OX_BARE_METAL OFF)
endif()
set(OX_RUN_TESTS ${OX_RUN_TESTS} CACHE BOOL "Run tests (ON/OFF)")
set(OX_BUILD_EXEC ${OX_BUILD_EXEC} CACHE BOOL "Build executables (ON/OFF)")
set(OX_USE_STDLIB ${OX_USE_STDLIB} CACHE BOOL "Build libraries that need the std lib (ON/OFF)")
set(OX_BARE_METAL ${OX_BARE_METAL} CACHE BOOL "Bare metal build (TRUE/FALSE)")
if(DEFINED ENV{OX_NODEBUG})
set(OX_NODEBUG ON)
endif()
# can't run tests without building them
if(NOT OX_BUILD_EXEC OR NOT OX_USE_STDLIB)
set(OX_BUILD_EXEC OFF)
set(OX_RUN_TESTS OFF)
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(-DNDEBUG)
else()
add_definitions(-DDEBUG)
endif()
if(NOT OX_USE_STDLIB)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib")
endif()
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wcast-align")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wdouble-promotion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wmissing-field-initializers")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnull-dereference")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-conversion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-variable")
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()
# forces colored output when using ninja
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color")
endif()
enable_testing()
include_directories(src)
install(FILES OxConfig.cmake DESTINATION lib/cmake/ox)
if(OX_USE_STDLIB)
set(JSONCPP_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/deps/jsoncpp/include")
add_subdirectory(deps/jsoncpp)
endif()
add_subdirectory(deps/cityhash)
add_subdirectory(src)