Skip to content

Commit

Permalink
Merge pull request #1 from palanceli/dev
Browse files Browse the repository at this point in the history
修改CMakeList文件
  • Loading branch information
palanceli authored Aug 15, 2019
2 parents 1eb15a4 + 5db061c commit 1317f63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@
*.exe
*.out
*.app
build/
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
project(googlepinyin)
cmake_minimum_required(VERSION 2.6)

option(ENABLE_STATIC "Build static library" False)
option(ENABLE_STATIC "Build static library" True)

# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)

# 加上下面这行以屏蔽Warning: MACOSX_RPATH is not specified
SET(CMAKE_MACOSX_RPATH 1)

SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})

add_custom_target(uninstall
Expand All @@ -26,7 +29,10 @@ set(datadir ${CMAKE_INSTALL_PREFIX}/share)
set(localedir ${CMAKE_INSTALL_PREFIX}/share/locale)
set(includedir ${CMAKE_INSTALL_PREFIX}/include/googlepinyin)
set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAG}")

#set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAG}") # 在mac OS下会报错,用下面这行替换
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-undefined,error ${CMAKE_SHARED_LINKER_FLAG}")


add_subdirectory(src)
add_subdirectory(tools)
Expand Down

0 comments on commit 1317f63

Please sign in to comment.