Skip to content

Commit 3012765

Browse files
committed
Replace part of manually added options.
1 parent ed6c255 commit 3012765

File tree

4 files changed

+156
-291
lines changed

4 files changed

+156
-291
lines changed

cppan.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ projects:
234234
)
235235
set(src ${src} ${f})
236236
237-
set(f ${BDIR}/options_cl.generated.h ${BDIR}/options_cl.generated.cpp)
237+
set(f ${BDIR}/options_cl.generated.h)
238238
add_custom_command(OUTPUT ${f}
239-
COMMAND ${cl_generator} ${SDIR}/src/driver/cpp/options_cl.yml ${f}
239+
COMMAND ${cl_generator} ${SDIR}/src/driver/cpp/options_cl.yml ${f} ${BDIR}/options_cl.generated.cpp
240240
DEPENDS ${cl_generator} ${SDIR}/src/driver/cpp/options_cl.yml
241241
)
242-
set(src ${src} ${f})
242+
set(src ${src} ${f} ${SDIR}/src/driver/cpp/options_cl.yml)
243243
244244
post_target: |
245245
cppan_flex_bison_internal(src/driver/cpp/bazel/lexer.ll PARSERS src/driver/cpp/bazel/grammar.yy)

src/driver/cpp/options_cl.yml

Lines changed: 109 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ types:
105105
cppstd:
106106
name: CPPStandard
107107
type: CPPLanguageStandard
108+
function_current: getCommandLineImplCPPLanguageStandardVS
108109
function: |
109110
String s = "-std:c++";
110111
switch (v)
@@ -190,7 +191,7 @@ types:
190191
exh:
191192
name: ExceptionHandlingModel
192193
type: vs::ExceptionHandlingVector
193-
value: vs::ExceptionHandlingVector{ vs::ExceptionHandling{} }
194+
default: vs::ExceptionHandlingVector{ vs::ExceptionHandling{} }
194195

195196
struct: |
196197
struct ExceptionHandling
@@ -261,7 +262,7 @@ types:
261262
flag: Fd
262263
type: path
263264
properties:
264-
- intermediate_dependency
265+
- intermediate_file
265266

266267
pchfn:
267268
name: PrecompiledHeaderFilename
@@ -400,9 +401,115 @@ types:
400401
- csf
401402
- cppsf
402403

404+
# common for lib.exe and link.exe
405+
# https://docs.microsoft.com/en-us/cpp/build/reference/linker-options
406+
vslt:
407+
name: VisualStudioLibraryToolOptions
408+
parent: VisualStudioCommonOptions
409+
410+
flags:
411+
ifiles:
412+
name: InputFiles
413+
type: Files
414+
properties:
415+
- input_dependency
416+
417+
lds:
418+
name: LinkDirectories
419+
type: FilesOrdered
420+
flag: "LIBPATH:"
421+
properties:
422+
- input_dependency
423+
- flag_before_each_value
424+
425+
mt:
426+
name: Machine
427+
type: vs::MachineType
428+
flag: "MACHINE:"
429+
default: vs::MachineType::X64
403430

431+
def:
432+
name: DefinitionFile
433+
type: path
434+
flag: "DEF:"
435+
properties:
436+
- input_dependency
404437

438+
implib:
439+
name: ImportLibrary
440+
type: path
441+
flag: "IMPLIB:"
442+
properties:
443+
# why? implib must present for dlls
444+
# some dlls might be generated without implibs for dynamic loading only
445+
- intermediate_file
405446

447+
out:
448+
name: Output
449+
type: path
450+
flag: "OUT:"
451+
properties:
452+
- output_dependency
406453

454+
vslib:
455+
name: VisualStudioLibrarianOptions
407456

457+
# https://docs.microsoft.com/en-us/cpp/build/reference/linker-options
458+
vslink:
459+
name: VisualStudioLinkerOptions
408460

461+
flags:
462+
ild:
463+
name: InputLibraryDependencies
464+
type: FilesOrdered
465+
properties:
466+
- input_dependency
467+
468+
dll:
469+
name: Dll
470+
type: bool
471+
flag: "DLL:"
472+
properties:
473+
- config_variable
474+
475+
delay:
476+
name: DelayLoadDlls
477+
type: FilesOrdered
478+
flag: "DELAYLOAD:"
479+
properties:
480+
- flag_before_each_value
481+
482+
dbg:
483+
name: GenerateDebugInfo
484+
type: bool
485+
flag: DEBUG
486+
487+
frc:
488+
name: Force
489+
type: vs::ForceType
490+
flag: "FORCE:"
491+
492+
pdb:
493+
name: PDBFilename
494+
type: path
495+
flag: "PDB:"
496+
properties:
497+
- output_dependency
498+
499+
noentr:
500+
name: NoEntry
501+
type: bool
502+
flag: NOENTRY
503+
504+
sub:
505+
name: Subsystem
506+
type: vs::Subsystem
507+
flag: "SUBSYSTEM:"
508+
default: vs::Subsystem::Console
509+
510+
ignw:
511+
name: IgnoreWarnings
512+
type: std::set<int>
513+
flag: "IGNORE:"
514+
properties:
515+
- flag_before_each_value

0 commit comments

Comments
 (0)