Skip to content

Commit

Permalink
fix PIC flag on old version of cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Dyer committed Apr 2, 2015
1 parent b5d04f4 commit 737ed7a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions decoder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../mteval)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../klm)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..)

PROJECT(decoder C CXX)
PROJECT(decoder CXX)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if (CMAKE_VERSION VERSION_LESS 2.8.9) # TODO remove once we increase the cmake requirement
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
else()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

find_package(FLEX REQUIRED)

Expand Down
6 changes: 5 additions & 1 deletion utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if (CMAKE_VERSION VERSION_LESS 2.8.9) # TODO remove once we increase the cmake requirement
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
else()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

set(TEST_SRCS dict_test.cc
logval_test.cc
Expand Down

0 comments on commit 737ed7a

Please sign in to comment.