Skip to content

Commit

Permalink
Simplify the CMake hack for LLVM12
Browse files Browse the repository at this point in the history
  • Loading branch information
Jcd1230 committed Jul 11, 2021
1 parent 5f774f5 commit 4407fed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
### Terra Generated Source Files
###

if(LLVM_VERSION_MAJOR GREATER 11)
set(ALL_LLVM_LIBRARIES clang-cpp LLVM)
endif()

if(TERRA_ENABLE_CUDA)
list(APPEND TERRA_CUDA_INCLUDE_DIRS
${CUDA_INCLUDE_DIRS}
Expand Down Expand Up @@ -197,11 +201,13 @@ add_dependencies(TerraObjectFiles TerraGeneratedFiles)
add_library(TerraLibrary
STATIC
$<TARGET_OBJECTS:TerraObjectFiles>
${ALL_LLVM_OBJECTS}
${LUAJIT_OBJECTS}
)
add_library(TerraLibraryShared
SHARED
$<TARGET_OBJECTS:TerraObjectFiles>
${ALL_LLVM_OBJECTS}
${LUAJIT_OBJECTS}
)

Expand Down Expand Up @@ -229,7 +235,8 @@ set_target_properties(TerraLibraryShared PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${
target_link_libraries(TerraLibraryShared
PRIVATE
${LUAJIT_LIBRARIES}
-lclang-cpp
${ALL_LLVM_LIBRARIES}
${LLVM_SYSTEM_LIBRARIES}
)

if(APPLE)
Expand Down Expand Up @@ -330,8 +337,6 @@ elseif(UNIX)
-Wl,--whole-archive
TerraLibrary
-Wl,--no-whole-archive
LLVM
-lclang-cpp
${LUAJIT_LIBRARIES}
${ALL_LLVM_LIBRARIES}
${LLVM_SYSTEM_LIBRARIES}
Expand Down

0 comments on commit 4407fed

Please sign in to comment.