File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -186,11 +186,6 @@ foreach (i ${RUNTIME_BC} )
186
186
list (APPEND INITIAL_MODULES "${INITMOD} " )
187
187
endforeach ()
188
188
189
- add_library (InitialModules STATIC
190
- ${INITIAL_MODULES} )
191
-
192
- add_dependencies (InitialModules
193
- bitcode2cpp)
194
189
195
190
set (HEADER_FILES
196
191
AddImageChecks.h
@@ -433,6 +428,7 @@ add_library(Halide ${HALIDE_LIBRARY_TYPE}
433
428
${BITWRITER_FILES}
434
429
"${CMAKE_BINARY_DIR} /include/Halide.h"
435
430
${HEADER_FILES}
431
+ ${INITIAL_MODULES}
436
432
)
437
433
438
434
# List of LLVM Components required
@@ -525,7 +521,12 @@ else()
525
521
string (REPLACE " " ";" LIBS "${LIBS_SPACES} " )
526
522
endif ()
527
523
528
- target_link_libraries (Halide PUBLIC InitialModules ${LIBS} )
524
+ # When building a shared library the LLVM libraries will be
525
+ # embedded in the Halide library. When building a static library
526
+ # LLVM is not embedded but CMake knows that when building an executable
527
+ # against the Halide static library that it needs to link LLVM too so
528
+ # PRIVATE scope is the correct choice here.
529
+ target_link_libraries (Halide PRIVATE ${LIBS} )
529
530
530
531
if (NOT WIN32 )
531
532
if (${LLVM_VERSION} GREATER 34)
@@ -541,6 +542,6 @@ if (NOT WIN32)
541
542
endif ()
542
543
543
544
add_dependencies (Halide
544
- InitialModules
545
+ bitcode2cpp
545
546
build_halide_h
546
547
)
You can’t perform that action at this time.
0 commit comments