GithubHelp home page GithubHelp logo

Comments (15)

finneyj avatar finneyj commented on June 28, 2024

Yes, this seems to be a windows feature - my build suffers from this also. Something in there is forcing a clean rebuild... @jamesadevine is it possible to test a ninja-less build with just cmake?

from codal.

jamesadevine avatar jamesadevine commented on June 28, 2024

Nothing forces a clean rebuild. The script enters the build folder and executes ninja.

from codal.

finneyj avatar finneyj commented on June 28, 2024

Is there a way to not use ninja though? As a means to honing in on the cause of the problem?

from codal.

jamesadevine avatar jamesadevine commented on June 28, 2024

Ah I see, you can use whatever build system you want...

cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -G \"Ninja\"

Change Ninja to any other supported one listed here:

https://cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html#command-line-build-tool-generators

There are not many options for windows, and make runs really slowly.

I imagine this is specific to ninja as partial rebuilding is supported on Mac using make.

ninja -d explain will help diagnose the cause.

from codal.

finneyj avatar finneyj commented on June 28, 2024

Ta. Yes, just looking. make doesn't run slowly compared to a clean rebuild all the time . ;)

I've just been digging and it seems to come down to one header file that (I guess) is being regenerated every build, which in turn makes everything look dirty. My windows logs are full of:

ninja explain: output libraries/mbed-classic/CMakeFiles/mbed-classic.dir/targets/hal/TARGET_Atmel/TARGET_SAM_CortexM0P/spi_api.c.obj older than most recent input C:/git/CircuitPlayground/codal/build/codal_extra_definitions.h (535300971 vs 535301080)
ninja explain: libraries/mbed-classic/CMakeFiles/mbed-classic.dir/targets/hal/TARGET_Atmel/TARGET_SAM_CortexM0P/spi_api.c.obj is dirty
ninja explain: output libraries/mbed-classic/CMakeFiles/mbed-classic.dir/targets/hal/TARGET_Atmel/TARGET_SAM_CortexM0P/us_ticker.c.obj older than most recent input C:/git/CircuitPlayground/codal/build/codal_extra_definitions.h (535300971 vs 535301080)
ninja explain: libraries/mbed-classic/CMakeFiles/mbed-classic.dir/targets/hal/TARGET_Atmel/TARGET_SAM_CortexM0P/us_ticker.c.obj is dirty
.
.
.

from codal.

finneyj avatar finneyj commented on June 28, 2024

I'll have a look to see if we can do something more optimised with that header file.

from codal.

jamesadevine avatar jamesadevine commented on June 28, 2024

ok - quick test then... Could you just run ninja in the build folder, and see if that partially rebuilds?

from codal.

finneyj avatar finneyj commented on June 28, 2024

already tried that - it doesn't rebuild, just relinks the final binaries...

Anything magical about "codal_extra_definitions.h" in the build process?

from codal.

jamesadevine avatar jamesadevine commented on June 28, 2024

Could you replace the similar looking code at line 175, with this:

# create a header file from the definitions specified in JSON
if("${CODAL_DEFINITIONS}" STRGREATER "")
    set(EXTRA_INCLUDES_NEW_PATH "${PROJECT_SOURCE_DIR}/build/codal_extra_definitions_new.h")
    set(EXTRA_INCLUDES_PATH "${PROJECT_SOURCE_DIR}/build/codal_extra_definitions.h")
    file(WRITE "${EXTRA_INCLUDES_NEW_PATH}" ${CODAL_DEFINITIONS})
    configure_file(${EXTRA_INCLUDES_PATH} ${EXTRA_INCLUDES_NEW_PATH} COPYONLY)

    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${EXTRA_INCLUDES_PATH}")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${EXTRA_INCLUDES_PATH}")
endif()

And report back?

from codal.

finneyj avatar finneyj commented on June 28, 2024

yes, I was just looking slightly askew at that code. Will try now.

from codal.

jamesadevine avatar jamesadevine commented on June 28, 2024

It looks like make does its' diff process differently to ninja.

from codal.

finneyj avatar finneyj commented on June 28, 2024

yup - that fixes it for me.

from codal.

jamesadevine avatar jamesadevine commented on June 28, 2024

Great, will push.

from codal.

finneyj avatar finneyj commented on June 28, 2024

Thanks James.

from codal.

jamesadevine avatar jamesadevine commented on June 28, 2024

281e03d

from codal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.