openframeworks / apothecary

This is the OpenFrameworks library apothecary. It mixes formulas and potions to build and update the C/C++ lib dependencies.
Other
56 stars 51 forks source link

[feature] fmt #350

Closed danoli3 closed 6 months ago

danoli3 commented 6 months ago

Add fmt https://github.com/openframeworks/apothecary/issues/304

Initial runner test

dimitre commented 6 months ago

Greaaattt

danoli3 commented 6 months ago

Okay concept and execution for Emscripten build process in the last commit:

if(EMSCRIPTEN)
    set(FMT_WASM_SOURCES
        ${FMT_SOURCES}
        ${FMT_HEADERS}
    )
    add_executable(fmt_wasm
        ${FMT_WASM_SOURCES}
    )
    target_include_directories(fmt_wasm PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/include
    )
    set_target_properties(fmt_wasm PROPERTIES COMPILE_FLAGS "-Os -s SIDE_MODULE=1 ")
    set_target_properties(fmt_wasm PROPERTIES LINK_FLAGS    "-Os -s WASM=1 -s SIDE_MODULE=1 -s STANDALONE_WASM --no-entry")
    set(CMAKE_EXECUTABLE_SUFFIX ".wasm")

endif()

This should work we will need to test linking.

elif [ "$TYPE" == "emscripten" ]; then
        mkdir -p build_$TYPE
      cd build_$TYPE
      $EMSDK/upstream/emscripten/emcmake cmake .. \
       ${DEFS} \
       -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
       -DCMAKE_C_STANDARD=17 \
    -DCMAKE_CXX_STANDARD=17 \
    -DCMAKE_CXX_STANDARD_REQUIRED=ON \
    -DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -std=c++17 -Wno-implicit-function-declaration -frtti ${FLAG_RELEASE}" \
    -DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -std=c17 -Wno-implicit-function-declaration -frtti ${FLAG_RELEASE}" \
    -DCMAKE_CXX_EXTENSIONS=OFF \
    -DBUILD_SHARED_LIBS=OFF \
          -DCMAKE_INSTALL_PREFIX=Release \
          -DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \
          -DCMAKE_INSTALL_INCLUDEDIR=include \
          -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE=. \
          -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=. \
          -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. 
      cmake --build . --target install --config Release
      cd ..
fi
danoli3 commented 6 months ago

PR against origin fmt: https://github.com/fmtlib/fmt/pull/3852

Added to local formulae /fmt folder with patch for now