-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This improved wasm builds. It also removes all the warnings during wa…
…sm builds.
- Loading branch information
Showing
6 changed files
with
103 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,55 @@ | ||
## building ojph_compress | ||
######################### | ||
|
||
include_directories(../common) | ||
|
||
file(GLOB OJPH_COMPRESS "ojph_compress.cpp") | ||
file(GLOB OJPH_IMG_IO "../others/ojph_img_io*.cpp") | ||
file(GLOB OJPH_IMG_IO_H "../common/ojph_img_io.h") | ||
|
||
if(NOT OJPH_DISABLE_INTEL_SIMD) | ||
list(REMOVE_ITEM OJPH_IMG_IO ${OJPH_IMG_IO_SSE41}) | ||
list(REMOVE_ITEM OJPH_IMG_IO ${OJPH_IMG_IO_AVX2}) | ||
endif() | ||
|
||
source_group("main" FILES ${OJPH_COMPRESS}) | ||
source_group("others" FILES ${OJPH_IMG_IO}) | ||
source_group("common" FILES ${OJPH_IMG_IO_H}) | ||
|
||
if(OJPH_BUILD_EXECUTABLES) | ||
add_executable(ojph_compress ${OJPH_COMPRESS} ${OJPH_IMG_IO} ${OJPH_IMG_IO_H}) | ||
endif() | ||
|
||
if (MSVC) | ||
set_source_files_properties(../others/ojph_img_io_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2") | ||
else() | ||
set_source_files_properties(../others/ojph_img_io_sse41.cpp PROPERTIES COMPILE_FLAGS -msse4.1) | ||
set_source_files_properties(../others/ojph_img_io_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2) | ||
endif() | ||
|
||
if(OJPH_BUILD_EXECUTABLES) | ||
if( USE_TIFF ) | ||
target_link_libraries(ojph_compress PUBLIC openjph ${TIFF_LIBRARIES}) | ||
include_directories(../common) | ||
include_directories(../../core/common) | ||
|
||
file(GLOB OJPH_COMPRESS "ojph_compress.cpp") | ||
file(GLOB OJPH_IMG_IO "../others/ojph_img_io.cpp") | ||
file(GLOB OJPH_IMG_IO_SSE4 "../others/ojph_img_io_sse41.cpp") | ||
file(GLOB OJPH_IMG_IO_AVX2 "../others/ojph_img_io_avx2.cpp") | ||
file(GLOB OJPH_IMG_IO_H "../common/ojph_img_io.h") | ||
|
||
list(APPEND SOURCES ${OJPH_COMPRESS} ${OJPH_IMG_IO} ${OJPH_IMG_IO_H}) | ||
|
||
source_group("main" FILES ${OJPH_COMPRESS}) | ||
source_group("others" FILES ${OJPH_IMG_IO}) | ||
source_group("common" FILES ${OJPH_IMG_IO_H}) | ||
|
||
if(EMSCRIPTEN) | ||
add_compile_options(-std=c++11 -O3 -fexceptions -DOJPH_DISABLE_INTEL_SIMD) | ||
add_executable(ojph_compress ${SOURCES}) | ||
add_executable(ojph_compress_simd ${SOURCES} ${OJPH_IMG_IO_SSE4}) | ||
target_compile_options(ojph_compress_simd PRIVATE -DOJPH_ENABLE_WASM_SIMD -msimd128 -msse4.1) | ||
source_group("others" FILES ${OJPH_IMG_IO_SSE4}) | ||
|
||
target_link_libraries(ojph_compress PRIVATE openjph) | ||
install(TARGETS ojph_compress DESTINATION bin) | ||
target_link_libraries(ojph_compress_simd PRIVATE openjphsimd) | ||
install(TARGETS ojph_compress_simd DESTINATION bin) | ||
else() | ||
target_link_libraries(ojph_compress PUBLIC openjph) | ||
if(NOT OJPH_DISABLE_INTEL_SIMD) | ||
add_executable(ojph_compress ${SOURCES} ${OJPH_IMG_IO_SSE4} ${OJPH_IMG_IO_AVX2}) | ||
|
||
if (MSVC) | ||
set_source_files_properties(${OJPH_IMG_IO_AVX2} PROPERTIES COMPILE_FLAGS "/arch:AVX2") | ||
else() | ||
set_source_files_properties(${OJPH_IMG_IO_SSE4} PROPERTIES COMPILE_FLAGS -msse4.1) | ||
set_source_files_properties(${OJPH_IMG_IO_AVX2} PROPERTIES COMPILE_FLAGS -mavx2) | ||
endif() | ||
else() | ||
add_executable(ojph_compress ${SOURCES}) | ||
endif() | ||
|
||
if( USE_TIFF ) | ||
target_link_libraries(ojph_compress PUBLIC openjph ${TIFF_LIBRARIES}) | ||
else() | ||
target_link_libraries(ojph_compress PUBLIC openjph) | ||
endif() | ||
|
||
install(TARGETS ojph_compress DESTINATION bin) | ||
endif() | ||
endif() | ||
|
||
install(TARGETS ojph_compress DESTINATION bin) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,55 @@ | ||
## building ojph_expand | ||
####################### | ||
|
||
include_directories(../common) | ||
|
||
file(GLOB OJPH_EXPAND "ojph_expand.cpp") | ||
file(GLOB OJPH_IMG_IO "../others/ojph_img_io*.cpp") | ||
file(GLOB OJPH_IMG_IO_H "../common/ojph_img_io.h") | ||
|
||
if(NOT OJPH_DISABLE_INTEL_SIMD) | ||
list(REMOVE_ITEM OJPH_IMG_IO ${OJPH_IMG_IO_SSE41}) | ||
list(REMOVE_ITEM OJPH_IMG_IO ${OJPH_IMG_IO_AVX2}) | ||
endif() | ||
|
||
source_group("main" FILES ${OJPH_EXPAND}) | ||
source_group("others" FILES ${OJPH_IMG_IO}) | ||
source_group("common" FILES ${OJPH_IMG_IO_H}) | ||
|
||
if(OJPH_BUILD_EXECUTABLES) | ||
add_executable(ojph_expand ${OJPH_EXPAND} ${OJPH_IMG_IO} ${OJPH_IMG_IO_H}) | ||
endif() | ||
|
||
if (MSVC) | ||
set_source_files_properties(../others/ojph_img_io_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2") | ||
else() | ||
set_source_files_properties(../others/ojph_img_io_sse41.cpp PROPERTIES COMPILE_FLAGS -msse4.1) | ||
set_source_files_properties(../others/ojph_img_io_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2) | ||
endif() | ||
|
||
if(OJPH_BUILD_EXECUTABLES) | ||
if( USE_TIFF ) | ||
target_link_libraries(ojph_expand PUBLIC openjph ${TIFF_LIBRARIES}) | ||
include_directories(../common) | ||
include_directories(../../core/common) | ||
|
||
file(GLOB OJPH_EXPAND "ojph_expand.cpp") | ||
file(GLOB OJPH_IMG_IO "../others/ojph_img_io.cpp") | ||
file(GLOB OJPH_IMG_IO_SSE4 "../others/ojph_img_io_sse41.cpp") | ||
file(GLOB OJPH_IMG_IO_AVX2 "../others/ojph_img_io_avx2.cpp") | ||
file(GLOB OJPH_IMG_IO_H "../common/ojph_img_io.h") | ||
|
||
list(APPEND SOURCES ${OJPH_EXPAND} ${OJPH_IMG_IO} ${OJPH_IMG_IO_H}) | ||
|
||
source_group("main" FILES ${OJPH_EXPAND}) | ||
source_group("others" FILES ${OJPH_IMG_IO}) | ||
source_group("common" FILES ${OJPH_IMG_IO_H}) | ||
|
||
if(EMSCRIPTEN) | ||
add_compile_options(-std=c++11 -O3 -fexceptions -DOJPH_DISABLE_INTEL_SIMD) | ||
add_executable(ojph_expand ${SOURCES}) | ||
add_executable(ojph_expand_simd ${SOURCES} ${OJPH_IMG_IO_SSE4}) | ||
target_compile_options(ojph_expand_simd PRIVATE -DOJPH_ENABLE_WASM_SIMD -msimd128 -msse4.1) | ||
source_group("others" FILES ${OJPH_IMG_IO_SSE4}) | ||
|
||
target_link_libraries(ojph_expand PRIVATE openjph) | ||
install(TARGETS ojph_expand DESTINATION bin) | ||
target_link_libraries(ojph_expand_simd PRIVATE openjphsimd) | ||
install(TARGETS ojph_expand_simd DESTINATION bin) | ||
else() | ||
target_link_libraries(ojph_expand PUBLIC openjph) | ||
if(NOT OJPH_DISABLE_INTEL_SIMD) | ||
add_executable(ojph_expand ${SOURCES} ${OJPH_IMG_IO_SSE4} ${OJPH_IMG_IO_AVX2}) | ||
|
||
if (MSVC) | ||
set_source_files_properties(${OJPH_IMG_IO_AVX2} PROPERTIES COMPILE_FLAGS "/arch:AVX2") | ||
else() | ||
set_source_files_properties(${OJPH_IMG_IO_SSE4} PROPERTIES COMPILE_FLAGS -msse4.1) | ||
set_source_files_properties(${OJPH_IMG_IO_AVX2} PROPERTIES COMPILE_FLAGS -mavx2) | ||
endif() | ||
else() | ||
add_executable(ojph_expand ${SOURCES}) | ||
endif() | ||
|
||
if( USE_TIFF ) | ||
target_link_libraries(ojph_expand PUBLIC openjph ${TIFF_LIBRARIES}) | ||
else() | ||
target_link_libraries(ojph_expand PUBLIC openjph) | ||
endif() | ||
|
||
install(TARGETS ojph_expand DESTINATION bin) | ||
endif() | ||
endif() | ||
|
||
install(TARGETS ojph_expand DESTINATION bin) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters