mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-08-16 16:19:30 +00:00
It looks like #7 didn't update CMakeLists.txt properly - defines specified with -D have to be added as compile definitions. Additionally, -O3 must be specified redundantly as a compile option and as a link option - compile option makes .wasm bits small & fast, and link option enables JS minifier. After this fix CMake build results in minimal js/wasm files as well.
22 lines
652 B
CMake
22 lines
652 B
CMake
cmake_minimum_required(VERSION 3.0)
|
|
|
|
project(basisu_transcoder_js)
|
|
|
|
if (EMSCRIPTEN)
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
add_executable(basis_transcoder.js
|
|
../../transcoder/basisu_transcoder.cpp
|
|
basis_wrappers.cpp
|
|
)
|
|
|
|
target_compile_definitions(basis_transcoder.js PRIVATE NDEBUG BASISD_SUPPORT_BC7=0)
|
|
target_compile_options(basis_transcoder.js PRIVATE -O3)
|
|
target_include_directories(basis_transcoder.js PRIVATE ../../transcoder)
|
|
|
|
set_target_properties(basis_transcoder.js PROPERTIES
|
|
OUTPUT_NAME "basis_transcoder"
|
|
SUFFIX ".js"
|
|
LINK_FLAGS "--bind -s ALLOW_MEMORY_GROWTH=1 -O3 -s ASSERTIONS=0 -s MALLOC=emmalloc")
|
|
endif()
|