citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

configure.bat (2712B)


      1 @ECHO off
      2 ECHO ░█▀▀░░░▀█▀░▀█▀░░░█▀▄░█░█░█▀█
      3 ECHO ░█░░░░░░█░░░█░░░░█▀▄░█░█░█░█
      4 ECHO ░▀▀▀░░░▀▀▀░░▀░░░░▀░▀░▀▀▀░▀░▀
      5 ECHO Configuring...
      6 ECHO.
      7 
      8 ::
      9 :: Need to 'setlocal' otherwise Path modifications get saved to the parent shell.
     10 :: Extends to end of file so we have these modifications the entire time.
     11 ::
     12 SETLOCAL
     13 SET Path=C:\LLVM\bin;%Path%
     14 
     15 ::
     16 :: Check binaries needed for building are available.
     17 ::
     18 WHERE cl
     19 IF %ERRORLEVEL% NEQ 0 (
     20 	ECHO cl.exe not found on the Path!
     21 	ECHO Please make sure you run this script from a Developer Command Prompt.
     22 	ECHO.
     23 	PAUSE
     24 	EXIT /B 1
     25 )
     26 
     27 WHERE jam
     28 IF %ERRORLEVEL% NEQ 0 (
     29 	ECHO jam.exe not found on the Path!
     30 	PAUSE
     31 	EXIT /B 1
     32 )
     33 
     34 WHERE llvm-config 2>nul
     35 IF %ERRORLEVEL% NEQ 0 (
     36 	ECHO llvm-config.exe not found on the Path!
     37 	ECHO.
     38 	ECHO I had to compile LLVM sources to get this  executable.
     39 	ECHO.
     40 	ECHO Download LLVM sources from http://llvm.org/.
     41 	PAUSE
     42 	EXIT /B 1
     43 )
     44 
     45 :: Write prefix.h
     46 > prefix.h ECHO static const char *prefix = R"(%CD%)";
     47 
     48 :: Write citrun_wrap
     49 >  citrun_wrap.bat ECHO @ECHO off
     50 >> citrun_wrap.bat ECHO SETLOCAL
     51 >> citrun_wrap.bat ECHO SET Path=%CD%\compilers;%%PATH%%
     52 >> citrun_wrap.bat ECHO CALL %%*
     53 >> citrun_wrap.bat ECHO EXIT /B %%ERRORLEVEL%%
     54 >> citrun_wrap.bat ECHO ENDLOCAL
     55 
     56 :: Silence warning about exceptions being disabled from xlocale.
     57 >  Jamrules ECHO C++FLAGS = /D_HAS_EXCEPTIONS=0 ;
     58 >> Jamrules ECHO.
     59 
     60 >> Jamrules ECHO FONT_PATH = "C:\Windows\Fonts\consola.ttf" ;
     61 >> Jamrules ECHO.
     62 
     63 :: GL_CFLAGS = `pkg-config --cflags glfw3 glew freetype2` ;
     64 :: GL_LIBS = ${GL_EXTRALIB-} `pkg-config --libs glfw3 glew freetype2` ;
     65 :: GLTEST_LIBS  = `pkg-config --libs osmesa` ;
     66 
     67 >  llvm-config.out llvm-config --cxxflags
     68 SET /p inst_cflags=<llvm-config.out
     69 
     70 >> Jamrules ECHO INST_CFLAGS = -IC:\\Clang\\include %inst_cflags:\=\\% ;
     71 >> Jamrules ECHO.
     72 
     73 >  llvm-config.out llvm-config --ldflags
     74 SET /p inst_ldflags=<llvm-config.out
     75 
     76 >> Jamrules ECHO INST_LDFLAGS = -LIBPATH:C:\\Clang\\lib %inst_ldflags:\=\\% ;
     77 >> Jamrules ECHO.
     78 
     79 >  llvm-config.out llvm-config --libnames bitreader mcparser transformutils option
     80 >> llvm-config.out llvm-config --system-libs
     81 SET /p inst_libs_llvm=<llvm-config.out
     82 
     83 SET inst_libs_clang=clangAST.lib clangAnalysis.lib clangBasic.lib clangDriver.lib clangEdit.lib clangFrontend.lib clangFrontendTool.lib clangLex.lib clangParse.lib clangRewrite.lib clangRewriteFrontend.lib clangSema.lib clangSerialization.lib clangTooling.lib
     84 
     85 >> Jamrules ECHO INST_LIBS = %inst_libs_clang% %inst_libs_llvm%
     86 >> Jamrules ECHO shlwapi.lib version.lib ;
     87 
     88 DEL llvm-config.out
     89 ENDLOCAL