Unverified Commit 97c66f2c authored by Moritz Angermann's avatar Moritz Angermann Committed by GitHub
Browse files

Merge pull request #4891 from zw3rk/feature/c-only-main

Allow empty set of input modules.
parents 831e40c0 60f1f64c
......@@ -1268,7 +1268,11 @@ gbuild verbosity numJobs pkg_descr lbi bm clbi = do
runGhcProg compileTHOpts { ghcOptNoLink = toFlag True
, ghcOptNumJobs = numJobs }
unless (gbuildIsRepl bm) $
-- Do not try to build anything if there are no input files.
-- This can happen if the cabal file ends up with only cSrcs
-- but no Haskell modules.
unless ((null inputFiles && null inputModules)
|| gbuildIsRepl bm) $
runGhcProg compileOpts { ghcOptNoLink = toFlag True
, ghcOptNumJobs = numJobs }
......
-*-change-log-*-
2.2.0.0 (current development version)
* Cabal does not try to build an empty set of `inputModules` (#4890).
* Add `HexFloatLiterals` to `KnownExtension`
* Added `virtual-module` field, to allow modules that are not built
but registered (#4875).
......
#include <stdio.h>
int main(int argc, char **argv) {
printf("Hello world!");
return 0;
}
name: my
version: 0.1
license: BSD3
cabal-version: >= 2.1
build-type: Simple
executable foo
-- default-language is required by cabal-version >= 1.10
default-language: Haskell2010
main-is: foo.c
# Setup configure
Resolving dependencies...
Configuring my-0.1...
# Setup build
Preprocessing executable 'foo' for my-0.1..
Building executable 'foo' for my-0.1..
# Setup configure
Configuring my-0.1...
# Setup build
Preprocessing executable 'foo' for my-0.1..
Building executable 'foo' for my-0.1..
import Test.Cabal.Prelude
-- Test building an executable whose main() function is defined in a C
-- file
main = setupAndCabalTest $ setup_build []
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment