1
0
mirror of https://github.com/CPunch/Laika.git synced 2024-11-25 05:50:15 +00:00
Laika/CMakeLists.txt

57 lines
1.7 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.10)
project(Laika)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
2022-04-06 06:07:16 +00:00
execute_process(COMMAND git rev-parse --short HEAD OUTPUT_VARIABLE GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
# Set the project as the default startup project for VS
2022-03-15 17:57:58 +00:00
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT LaikaLib)
# include our cmake modules
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules" ${CMAKE_MODULE_PATH})
# Output binaries to the bin folder in the source directory
2022-04-04 20:54:41 +00:00
if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/winbin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/winbin)
else()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
endif()
2022-01-29 23:16:29 +00:00
#find_package(Sanitizers)
if(NOT CMAKE_BUILD_TYPE)
2022-03-15 18:24:29 +00:00
set(CMAKE_BUILD_TYPE Release)
endif ()
string(TOLOWER ${CMAKE_BUILD_TYPE} RAWCMAKEBUILDTYPE)
message(STATUS "CMAKE_BUILD_TYPE: " ${RAWCMAKEBUILDTYPE})
if(RAWCMAKEBUILDTYPE STREQUAL "debug")
message(STATUS "Adding sanitizer...")
2022-01-29 23:16:29 +00:00
#set(SANITIZE_ADDRESS TRUE)
#add_sanitizers(LaikaLib LaikaBot LaikaCNC)
# bug in FindSanitizer.cmake ??? idfk, i'll investigate l8tr
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif ()
# include libsodium
set(SODIUM_DISABLE_TESTS ON)
set(SODIUM_MINIMAL ON)
set(SODIUM_STATIC ON)
# compile laikalib, tools, cnc & bot
add_subdirectory(lib)
add_subdirectory(tools)
# these subprojects don't support windows (sorry)
add_subdirectory(bot) # windows support Soon:tm:
2022-03-15 17:57:58 +00:00
if(NOT WIN32 AND (UNIX AND NOT APPLE))
add_subdirectory(cnc)
add_subdirectory(shell)
2022-03-15 18:24:29 +00:00
endif ()