From fb0bbfd97cb1e5131526f1c3ac851218b5592330 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 5 Dec 2023 00:04:46 +0800 Subject: [PATCH] fix build --- src/ext/CMakeLists.txt | 18 ++++++++++-------- src/util/CMakeLists.txt | 7 ++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/ext/CMakeLists.txt b/src/ext/CMakeLists.txt index 21c7cb47..76ade159 100644 --- a/src/ext/CMakeLists.txt +++ b/src/ext/CMakeLists.txt @@ -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) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 993d71e6..2e7b1fe0 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -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})