Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,30 @@ include_directories(
SET (CMAKE_CXX_FLAGS "-std=c++11")
SET (LIB_SUFFIX "")

add_definitions(
-DNDEBUG
-DLINUX
-DAMD64
-g
-fshort-wchar
-fwide-exec-charset=UTF-16LE
-m64
)
IF(${MAPBAR_PLATFORM} STREQUAL "gnu_arm64")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是一个开源项目,不应使用 MAPBAR_PLATFORM 这样的变量。

set(LIB_SUFFIX "_gnu_arm64")
add_definitions(
-DNDEBUG
-DLINUX
-DAMD64
-g
-fshort-wchar
-fwide-exec-charset=UTF-16LE
)

ELSE()
set(LIB_SUFFIX "_linux_x64")
add_definitions(
-DNDEBUG
-DLINUX
-DAMD64
-g
-fshort-wchar
-fwide-exec-charset=UTF-16LE
-m64
)
ENDIF()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面两段文字,其实 x64 版本 跟 arm64 版本的差别只是是否要带 -m64,应该把 -m64 跟其他的分离开来单独处理,避免重复代码。


FILE(GLOB SRC "${BASE_PATH}/src/*.cpp" "${BASE_PATH}/src/*.c")
FILE(GLOB_RECURSE 3RD_SRC "${BASE_PATH}/3rd-party/*.cpp" "${BASE_PATH}/3rd-party/*.c")
Expand Down