cmake release/debug

This commit is contained in:
fluttershy 2025-01-20 17:08:23 +05:00
parent 10d0a81e84
commit 802478eab4
2 changed files with 19 additions and 10 deletions

View File

@ -4,6 +4,8 @@ project(sparkle)
include(GoogleTest)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(SOURCE sources/main.cpp)
set(LIBS ${CMAKE_SOURCE_DIR}/libs/)
set(INCLUDE ${CMAKE_SOURCE_DIR}/include/)
@ -23,6 +25,22 @@ if(NOT CURL_INCLUDE_DIRS OR NOT CURL_LIBRARIES)
message(FATAL_ERROR "curl not found")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
endif()
if(CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "-march=native -O0 -pipe")
add_definitions(-DDEBUG)
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(-DRELEASE)
set(CMAKE_CXX_FLAGS "-march=native -O2 -pipe")
endif()
endif()
message(STATUS "${CMAKE_BUILD_TYPE}")
add_executable(${PROJECT_NAME} ${SOURCE})
#add_library(sparkles STATIC ${SOURCE})
#add_executable(tests ${TESTS}/tests.cpp)
@ -58,8 +76,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
# ${IXWEBSOCKET_LIBRARIES}
# ${CURL_LIBRARIES}
# gtest_main
#)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "-march=native -O2 -pipe")
#)

View File

@ -1,8 +1,3 @@
#ifndef UTILS_TYPES_HPP_
#define UTILS_TYPES_HPP_
#define j(...) {{__VA_ARGS__}}
#define je(...) {__VA_ARGS__}
#define g(x, y) (std::get<x>(y))
#define ALL_INTENTS 131071
#define DEBUG
#endif