Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Leo-Smith committed Dec 4, 2023
1 parent a6045b3 commit fb0bbfd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
18 changes: 10 additions & 8 deletions src/ext/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,18 @@ target_link_libraries(luisa-render-ext INTERFACE assimp::assimp)
# tinyexr
set(TINYEXR_BUILD_SAMPLE OFF CACHE BOOL "" FORCE)
if (ZLIB_FOUND)
add_library(luisa-render-ext-tinyexr OBJECT tinyexr.cpp)
target_compile_definitions(luisa-render-ext-tinyexr PUBLIC TINYEXR_USE_MINIZ=0)
target_link_libraries(luisa-render-ext-tinyexr PRIVATE ZLIB::ZLIB)
add_library(tinyexr SHARED tinyexr.cpp)
target_compile_definitions(tinyexr PUBLIC TINYEXR_USE_MINIZ=0)
target_link_libraries(tinyexr PRIVATE ZLIB::ZLIB)
else ()
add_library(luisa-render-ext-tinyexr SHARED tinyexr.cpp tinyexr/deps/miniz/miniz.c)
target_compile_definitions(luisa-render-ext-tinyexr PUBLIC TINYEXR_USE_MINIZ=1)
target_include_directories(luisa-render-ext-tinyexr PRIVATE tinyexr/deps/miniz)
add_library(tinyexr SHARED tinyexr.cpp tinyexr/deps/miniz/miniz.c)
target_compile_definitions(tinyexr PUBLIC TINYEXR_USE_MINIZ=1)
target_include_directories(tinyexr PRIVATE tinyexr/deps/miniz)
endif ()
target_include_directories(luisa-render-ext-tinyexr PUBLIC tinyexr)
target_link_libraries(luisa-render-ext-tinyexr PUBLIC ${CMAKE_DL_LIBS})
target_include_directories(tinyexr PUBLIC tinyexr)
target_link_libraries(tinyexr PUBLIC ${CMAKE_DL_LIBS})
set_target_properties(tinyexr PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
target_link_libraries(luisa-render-ext INTERFACE tinyexr)

# nlohmann json
add_library(nlohmann_json INTERFACE)
Expand Down
7 changes: 2 additions & 5 deletions src/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,10 @@ add_library(luisa-render-util SHARED
polymorphic_closure.h
command_buffer.cpp command_buffer.h
thread_pool.cpp thread_pool.h)
target_link_libraries(luisa-render-util
PUBLIC
target_link_libraries(luisa-render-util PUBLIC
luisa::compute
luisa-render-include
luisa-render-ext
PRIVATE
luisa-render-ext-tinyexr)
luisa-render-ext)
set_target_properties(luisa-render-util PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS ON
UNITY_BUILD ${LUISA_RENDER_ENABLE_UNITY_BUILD})

0 comments on commit fb0bbfd

Please sign in to comment.