build: reorganize CMake settings for better clarity (#23)

Streamline CMake configuration by consolidating compiler options and ensuring consistent export of compile commands, enhancing the build process especially for MSVC and Windows environments.
This commit is contained in:
zhangyi1357 2024-10-14 17:49:01 +08:00 committed by GitHub
parent 10153950c8
commit e83c3ce8fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,18 +88,18 @@ if(AIMRT_MASTER_PROJECT)
endif()
endif()
if(MSVC)
add_compile_options(/utf-8 /wd4819)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
endif()
if(WIN32)
add_compile_definitions(NOMINMAX)
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
if(MSVC)
add_compile_options(/utf-8 /wd4819)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus")
endif()
if(WIN32)
add_compile_definitions(NOMINMAX)
endif()
# Build document
if(AIMRT_BUILD_DOCUMENT)
message(STATUS "gen document ...")