Git Product home page Git Product logo

Comments (3)

versalinyaa avatar versalinyaa commented on May 2, 2024

More investigation. I think glslc should allow -MD with -o -, but only when -MT <depfile> is also given.

from shaderc.

versalinyaa avatar versalinyaa commented on May 2, 2024

NEVERMIND. glslc correctly behaves the same as gcc when given -o - with -M* options. Here is a test that demonstrates the gcc behavior.

#!/bin/bash

setup() {
    # Clean!
    rm -f hello* ./-*

    cat >hello.c <<-EOF
	#include "hello.h"
	
	int main(void) {
	    hello();
	    return 0;
	}
	EOF

    cat >hello.h <<-EOF
	#include <stdio.h>
	
	static inline void
	hello(void) {
	    printf("hello!\n");
	}
	EOF
}

start_test() {
    test_name="$1"
    echo "test $test_name ..."
}

pass() {
    echo "test $test_name ... pass"
}

fail() {
    echo "test $test_name ... fail"
    exit 1
}

testA() {
    start_test "A"
    setup || fail
    gcc -S -o - -MMD hello.c >/dev/null || fail
    [[ -f ./-.d ]] || fail
    [[ $(cat ./-.d) = "-: hello.c hello.h" ]] || fail
    pass
}

testB() {
    start_test "B"
    setup || fail
    gcc -S -o - -MMD -MF hello.o.d -MT hello.o hello.c >/dev/null || fail
    [[ -f hello.o.d ]] || fail
    [[ $(cat hello.o.d) = "hello.o: hello.c hello.h" ]] || fail
    pass
}

testA
testB

from shaderc.

dneto0 avatar dneto0 commented on May 2, 2024

My favourite kind of bug. :-)

Thanks for the explanation. Yes, we used gcc as the model for this feature. I'm glad we are close enough to it in behaviour.

from shaderc.

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.