This commit is contained in:
2025-11-29 03:47:13 +05:30
parent ad0a18c945
commit b8a613daa5
4 changed files with 189 additions and 4 deletions

View File

@ -16,6 +16,19 @@ enable_language(C)
# Default to ON if root, OFF if dependency
option(IACore_BUILD_TESTS "Build unit tests" ${PROJECT_IS_TOP_LEVEL})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "Configuring IACore for Debug..")
add_compile_options(-O0 -g)
add_compile_definitions("__IA_DEBUG=1")
elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
message(STATUS "Configuring IACore for Release..")
add_compile_options(-O3 -g0)
add_compile_definitions("__IA_DEBUG=0")
else()
message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\"")
endif()
message(STATUS "Detected Compiler ID: ${CMAKE_CXX_COMPILER_ID}")
# Check if the compiler is MSVC (cl.exe), but allow Clang acting like MSVC (clang-cl)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")