OvermindDL1 <overminddl1 at gmail.com> writes:>> Chris proposed on IRC to remove the Visual Studio project files and turn >> CMake into the "standard" for building LLVM with VC++. >> >> If you have strong arguments against this, please voice them. > > As long as instructions are supplied on how to pass in user defined > macros to the build system. I have to turn off a lot of the extra > safety crap that VC2k5 and higher added[snip]> I am sure I am not the only one that does that, so supplying such > instructions for how to add in your own preprocessor definitions would > be great.For C source files: cmake -DCMAKE_C_FLAGS="-DSOME_DEF=value -DSOME_OTHER_DEF=value" path/to/llvm For C++ source files: cmake -DCMAKE_CXX_FLAGS="-DSOME_DEF=value -DSOME_OTHER_DEF=value" path/to/llvm I'll add this to the docs. Please list those defines and I will add an option for enabling them all with a single -D cmake option. -- Oscar
On Mon, Nov 24, 2008 at 8:18 PM, Óscar Fuentes <ofv at wanadoo.es> wrote:> OvermindDL1 <overminddl1 at gmail.com> writes: > >>> Chris proposed on IRC to remove the Visual Studio project files and turn >>> CMake into the "standard" for building LLVM with VC++. >>> >>> If you have strong arguments against this, please voice them. >> >> As long as instructions are supplied on how to pass in user defined >> macros to the build system. I have to turn off a lot of the extra >> safety crap that VC2k5 and higher added > [snip] >> I am sure I am not the only one that does that, so supplying such >> instructions for how to add in your own preprocessor definitions would >> be great. > > For C source files: > > cmake -DCMAKE_C_FLAGS="-DSOME_DEF=value -DSOME_OTHER_DEF=value" path/to/llvm > > For C++ source files: > > cmake -DCMAKE_CXX_FLAGS="-DSOME_DEF=value -DSOME_OTHER_DEF=value" path/to/llvm > > I'll add this to the docs. > > Please list those defines and I will add an option for enabling them all > with a single -D cmake option. >He's talking about how VC++ deprecated (with warnings) many C/C++ functions (like strcpy, sprintf, std::copy, etc.) that a dumb developer could get exploited with. Turn them off with these: _CRT_SECURE_NO_WARNINGS // C deprecation _SCL_SECURE_NO_WARNINGS // C++ deprecation In addition to those, for Release builds I recommend disabling the "secure" stdlib features which does bounds checking and slows down a lot of good code: _SECURE_SCL=0 // slow secure stdlib. -- Cory Nelson http://www.int64.org
"Cory Nelson" <phrosty at gmail.com> writes:> On Mon, Nov 24, 2008 at 8:18 PM, Óscar Fuentes <ofv at wanadoo.es> wrote: >> OvermindDL1 <overminddl1 at gmail.com> writes: >>> As long as instructions are supplied on how to pass in user defined >>> macros to the build system. I have to turn off a lot of the extra >>> safety crap that VC2k5 and higher added >> [snip] >>> I am sure I am not the only one that does that, so supplying such >>> instructions for how to add in your own preprocessor definitions would >>> be great. >>[snip]> He's talking about how VC++ deprecated (with warnings) many C/C++ > functions (like strcpy, sprintf, std::copy, etc.) that a dumb > developer could get exploited with. Turn them off with these: > > _CRT_SECURE_NO_WARNINGS // C deprecation > _SCL_SECURE_NO_WARNINGS // C++ deprecation >Those and others already are defined by default: if( MSVC ) add_definitions( -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS ) add_definitions( -D_SCL_SECURE_NO_WARNINGS -DCRT_NONSTDC_NO_WARNINGS ) add_definitions( -D_SCL_SECURE_NO_DEPRECATE ) add_definitions( -wd4146 -wd4503 -wd4996 -wd4800 -wd4244 -wd4624 ) add_definitions( -wd4355 -wd4715 ) endif( MSVC )> In addition to those, for Release builds I recommend disabling the > "secure" stdlib features which does bounds checking and slows down a > lot of good code: > > _SECURE_SCL=0 // slow secure stdlib.This isn't, but adding an option for just one define does not save any work. -- Oscar
Reasonably Related Threads
- [LLVMdev] Removal of Visual Studio project files.
- [LLVMdev] Removal of Visual Studio project files.
- [LLVMdev] Building llvm and clang with mixed assertion modes
- [test-suite] making polybench/symm succeed with "-Ofast" and "-ffp-contract=on"
- [LLVMdev] Removal of Visual Studio project files.