@@ -226,7 +226,7 @@ macro(commom_lib_settings lib write)
226
226
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /lib/basisu/transcoder>
227
227
$<INSTALL_INTERFACE:lib/basisu/transcoder>
228
228
229
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /lib/basisu/transcoder >
229
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /lib/basisu/zstd >
230
230
$<INSTALL_INTERFACE:lib/basisu/zstd>
231
231
232
232
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /other_include>
@@ -237,17 +237,6 @@ macro(commom_lib_settings lib write)
237
237
target_compile_definitions (${lib} PUBLIC KHRONOS_STATIC)
238
238
endif ()
239
239
240
- # BASISD_SUPPORT_KTX2 has to be 1 to compile the encoder. We
241
- # don't use it. Hopefully it doesn't add too much code. We're using
242
- # the zstd encoder in basisu by explicitly including the file in our
243
- # source list. We don't need to related code in the encoder.
244
- target_compile_definitions (
245
- ${lib}
246
- PRIVATE
247
- BASISD_SUPPORT_KTX2_ZSTD=0
248
- BASISD_SUPPORT_KTX2=1
249
- )
250
-
251
240
# To reduce size, don't support transcoding to ancient formats.
252
241
target_compile_definitions (${lib} PRIVATE BASISD_SUPPORT_FXT1=0)
253
242
@@ -365,6 +354,13 @@ commom_lib_settings(ktx_read 0)
365
354
366
355
create_version_header(lib ktx)
367
356
357
+ target_compile_definitions (
358
+ ktx_read
359
+ PRIVATE
360
+ # We're reading the files ourselves so don't need Basis KTX v2 support.
361
+ BASISD_SUPPORT_KTX2_ZSTD=0
362
+ BASISD_SUPPORT_KTX2=0
363
+ )
368
364
369
365
# Adding write capability to target ktx
370
366
@@ -430,27 +426,23 @@ target_compile_definitions(
430
426
ktx
431
427
PUBLIC
432
428
KTX_FEATURE_WRITE
429
+ PRIVATE
430
+ # BASISD_SUPPORT_KTX2 has to be 1 to compile the encoder. We
431
+ # don't use it. Hopefully it doesn't add too much code. We're using
432
+ # the zstd encoder in basisu by explicitly including the file in our
433
+ # source list. We don't need the related code in the encoder.
434
+ BASISD_SUPPORT_KTX2_ZSTD=0
435
+ BASISD_SUPPORT_KTX2=1
436
+ $<$<BOOL :${BASISU_SUPPORT_SSE} >:BASISU_SUPPORT_SSE=1>
437
+ $<$<NOT :$<BOOL :${BASISU_SUPPORT_SSE} >>:BASISU_SUPPORT_SSE=0>
438
+ )
439
+ target_compile_options (
440
+ ktx
441
+ PRIVATE
442
+ $<$<AND :$<BOOL :${BASISU_SUPPORT_SSE} >,$<CXX_COMPILER_ID:AppleClang,Clang,GNU>>:
443
+ -msse4.1
444
+ >
433
445
)
434
- if (BASISU_SUPPORT_SSE)
435
- target_compile_definitions (
436
- ktx
437
- PRIVATE
438
- BASISU_SUPPORT_SSE=1
439
- )
440
- target_compile_options (
441
- ktx
442
- PRIVATE
443
- $<$<CXX_COMPILER_ID:AppleClang,Clang,GNU>:
444
- -msse4.1
445
- >
446
- )
447
- else ()
448
- target_compile_definitions (
449
- ktx
450
- PRIVATE
451
- BASISU_SUPPORT_SSE=0
452
- )
453
- endif ()
454
446
455
447
if (EMSCRIPTEN)
456
448
set (
0 commit comments