Skip to content

Commit

Permalink
Setup correct path to profile_rt for Mac OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
lqi committed Mar 26, 2013
1 parent 4d07049 commit 40d3b9c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
11 changes: 10 additions & 1 deletion oclint-core/cmake/OCLintConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SET(CLANG_LIBRARIES
clangAST
clangLex
clangBasic)

IF(TEST_BUILD)
ENABLE_TESTING()
ADD_DEFINITIONS(
Expand All @@ -47,4 +47,13 @@ IF(TEST_BUILD)
${GOOGLETEST_SRC}/gtest/include
)
LINK_DIRECTORIES(${GOOGLETEST_BUILD})

# Setup the path for profile_rt library
SET(COMPILER_RT_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}")
STRING(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_SYSTEM_NAME)
LINK_DIRECTORIES(${LLVM_LIBRARY_DIRS}/clang/${COMPILER_RT_VERSION}/lib/${COMPILER_RT_SYSTEM_NAME})
IF(APPLE)
SET(PROFILE_RT_LIBS clang_rt.profile_osx)
ELSE()
ENDIF()
ENDIF()
4 changes: 2 additions & 2 deletions oclint-core/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ MACRO(build_test name)
OCLintRuleSet
OCLintCore
gmock
profile_rt
${PROFILE_RT_LIBS}
${CLANG_LIBRARIES}
${REQ_LLVM_LIBRARIES}
${CMAKE_DL_LIBS}
${CMAKE_DL_LIBS}
)

ADD_TEST(${name} ${EXECUTABLE_OUTPUT_PATH}/${name})
Expand Down
2 changes: 1 addition & 1 deletion oclint-metrics/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MACRO(build_test name)
TARGET_LINK_LIBRARIES(${name}
OCLintMetric
gmock
profile_rt
${PROFILE_RT_LIBS}
${CLANG_LIBRARIES}
${REQ_LLVM_LIBRARIES}
${CMAKE_DL_LIBS}
Expand Down
2 changes: 1 addition & 1 deletion oclint-reporters/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MACRO(build_test name)
ADD_EXECUTABLE(${name} ${name}.cpp)
TARGET_LINK_LIBRARIES(${name}
gmock
profile_rt
${PROFILE_RT_LIBS}
OCLintCore
)

Expand Down
2 changes: 1 addition & 1 deletion oclint-rules/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MACRO(build_test name)
OCLintCore
OCLintRuleSet
gmock
profile_rt
${PROFILE_RT_LIBS}
${CLANG_LIBRARIES}
${REQ_LLVM_LIBRARIES}
)
Expand Down

0 comments on commit 40d3b9c

Please sign in to comment.