Skip to content

Commit

Permalink
[Fix] Fix example standalone build for msvc (#1626)
Browse files Browse the repository at this point in the history
* fix example build for msvc

* move /Zc:__cplusplus to core
  • Loading branch information
irexyc authored Jan 11, 2023
1 parent 3527412 commit 9a1f4e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ endif ()

if (MSVC)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/diagnostics:classic>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Zc:preprocessor>) # /experimental:preprocessor on VS2017
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Zc:__cplusplus>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/wd4251>)
endif ()

Expand Down
5 changes: 5 additions & 0 deletions csrc/mmdeploy/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ target_include_directories(${PROJECT_NAME}
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/third_party/json>
)

if (MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC
$<$<COMPILE_LANGUAGE:CXX>:/Zc:preprocessor;/Zc:__cplusplus>)
endif ()

if (MMDEPLOY_STATUS_USE_STACKTRACE)
include(${CMAKE_SOURCE_DIR}/cmake/stacktrace.cmake)
else ()
Expand Down

0 comments on commit 9a1f4e6

Please sign in to comment.