Skip to content

Commit

Permalink
修改cmake参数, 解决编译问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wysaid committed Dec 9, 2023
1 parent 4ff4852 commit 8f5de2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ endif ()
macro(ege_add_executable name source)
add_executable(${name} ${source})
target_link_libraries(${name} xege)
if (MSVC)
target_compile_options(${name} PRIVATE
/utf-8
/D_USE_MATH_DEFINES
/D__STDC_LIMIT_MACROS
/MP
)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if(CMAKE_HOST_UNIX)
target_link_options(${name}
Expand Down
7 changes: 0 additions & 7 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ add_custom_target(demos)
macro(ege_add_executable_demo name source)
ege_add_executable(${name} ${source})

if (MSVC)
target_compile_options(${name} PRIVATE
/utf-8
/D_USE_MATH_DEFINES
)
endif()

set_property(TARGET ${name}
PROPERTY EXCLUDE_FROM_ALL true)
add_dependencies(demos ${DEMO_NAME})
Expand Down

0 comments on commit 8f5de2f

Please sign in to comment.