satoshinm / NetCraft

Web-based fork of fogleman/Craft ⛺
https://satoshinm.github.io/NetCraft/
MIT License
56 stars 13 forks source link

Release build optimizations in CMAKE_BUILD_TYPE not set correctly #167

Closed satoshinm closed 7 years ago

satoshinm commented 7 years ago
    if (CMAKE_RELEASE_TYPE EQUAL "Release")
        set_property(TARGET craft APPEND_STRING PROPERTY LINK_FLAGS " -O3")

There is no CMAKE_RELEASE_TYPE, it should be CMAKE_BUILD_TYPE and use MATCHES instead of EQUAL at least from the example in http://cmake.3232098.n2.nabble.com/how-to-determine-debug-or-release-mode-td7371133.html.

Found when testing https://github.com/satoshinm/NetCraft/issues/165 since I changed to only preload in release builds (embed in debug builds) yet it wasn't being preloaded in wasm-build, but this issue may have been around for a while! Last committed 2 months ago in https://github.com/satoshinm/NetCraft/commit/e66027a8cd71b3514823fbe1bd78f9dee9d78efe

satoshinm commented 7 years ago

There is a different with optimizations, before:

-rw-r--r--  1 admin  staff   241K May 27 18:46 craft.data
-rw-r--r--  1 admin  staff   101K May 27 18:46 craft.html
-rw-r--r--  1 admin  staff    19K May 27 18:46 craft.html.mem
-rw-r--r--  1 admin  staff   624K May 27 18:46 craft.js

after:

-rw-r--r--  1 admin  staff   241K May 27 18:46 craft.data
-rw-r--r--  1 admin  staff   101K May 27 18:46 craft.html
-rw-r--r--  1 admin  staff    19K May 27 18:46 craft.html.mem
-rw-r--r--  1 admin  staff   590K May 27 18:46 craft.js