-
Notifications
You must be signed in to change notification settings - Fork 0
/
jln.cmake
1786 lines (1702 loc) · 77.3 KB
/
jln.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# File generated with https://github.com/jonathanpoelen/cpp-compiler-options
set(_JLN_COLOR_VALUES default auto never always)
set(_JLN_CONTROL_FLOW_VALUES default off on branch return allow_bugs)
set(_JLN_COVERAGE_VALUES default off on)
set(_JLN_CPU_VALUES default generic native)
set(_JLN_DEBUG_VALUES default off on line_tables_only gdb lldb sce)
set(_JLN_DIAGNOSTICS_FORMAT_VALUES default fixits patch print_source_range_info)
set(_JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE_VALUES default off on)
set(_JLN_ELIDE_TYPE_VALUES default off on)
set(_JLN_EXCEPTIONS_VALUES default off on)
set(_JLN_FIX_COMPILER_ERROR_VALUES default off on)
set(_JLN_LINKER_VALUES default bfd gold lld native)
set(_JLN_LTO_VALUES default off on fat thin)
set(_JLN_MSVC_ISYSTEM_VALUES default anglebrackets include_and_caexcludepath)
set(_JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL_VALUES default off on)
set(_JLN_OPTIMIZATION_VALUES default 0 g 1 2 3 fast size)
set(_JLN_PEDANTIC_VALUES default off on as_error)
set(_JLN_PIE_VALUES default off on pic)
set(_JLN_RELRO_VALUES default off on full)
set(_JLN_REPRODUCIBLE_BUILD_WARNINGS_VALUES default off on)
set(_JLN_RTTI_VALUES default off on)
set(_JLN_SANITIZERS_VALUES default off on)
set(_JLN_SANITIZERS_EXTRA_VALUES default off thread pointer)
set(_JLN_SHADOW_WARNINGS_VALUES default off on local compatible_local all)
set(_JLN_STACK_PROTECTOR_VALUES default off on strong all)
set(_JLN_STL_DEBUG_VALUES default off on allow_broken_abi allow_broken_abi_and_bugs assert_as_exception)
set(_JLN_STL_FIX_VALUES default off on)
set(_JLN_SUGGESTIONS_VALUES default off on)
set(_JLN_WARNINGS_VALUES default off on strict very_strict)
set(_JLN_WARNINGS_AS_ERROR_VALUES default off on basic)
set(_JLN_WHOLE_PROGRAM_VALUES default off on strip_all)
set(_JLN_VERBOSE_VALUES on off)
set(_JLN_AUTO_PROFILE_VALUES on off)
set(_JLN_DISABLE_OTHERS_VALUES on off)
set(JLN_COLOR "${JLN_COLOR}" CACHE STRING "")
if(NOT("${JLN_COLOR}" STREQUAL ""))
string(TOLOWER "${JLN_COLOR}" JLN_COLOR)
if(NOT(("default" STREQUAL JLN_COLOR) OR ("auto" STREQUAL JLN_COLOR) OR ("never" STREQUAL JLN_COLOR) OR ("always" STREQUAL JLN_COLOR)))
message(FATAL_ERROR "Unknow value \"${JLN_COLOR}\" for JLN_COLOR, expected: default, auto, never, always")
endif()
endif()
set(JLN_CONTROL_FLOW "${JLN_CONTROL_FLOW}" CACHE STRING "")
if(NOT("${JLN_CONTROL_FLOW}" STREQUAL ""))
string(TOLOWER "${JLN_CONTROL_FLOW}" JLN_CONTROL_FLOW)
if(NOT(("default" STREQUAL JLN_CONTROL_FLOW) OR ("off" STREQUAL JLN_CONTROL_FLOW) OR ("on" STREQUAL JLN_CONTROL_FLOW) OR ("branch" STREQUAL JLN_CONTROL_FLOW) OR ("return" STREQUAL JLN_CONTROL_FLOW) OR ("allow_bugs" STREQUAL JLN_CONTROL_FLOW)))
message(FATAL_ERROR "Unknow value \"${JLN_CONTROL_FLOW}\" for JLN_CONTROL_FLOW, expected: default, off, on, branch, return, allow_bugs")
endif()
endif()
set(JLN_COVERAGE "${JLN_COVERAGE}" CACHE STRING "")
if(NOT("${JLN_COVERAGE}" STREQUAL ""))
string(TOLOWER "${JLN_COVERAGE}" JLN_COVERAGE)
if(NOT(("default" STREQUAL JLN_COVERAGE) OR ("off" STREQUAL JLN_COVERAGE) OR ("on" STREQUAL JLN_COVERAGE)))
message(FATAL_ERROR "Unknow value \"${JLN_COVERAGE}\" for JLN_COVERAGE, expected: default, off, on")
endif()
endif()
set(JLN_CPU "${JLN_CPU}" CACHE STRING "")
if(NOT("${JLN_CPU}" STREQUAL ""))
string(TOLOWER "${JLN_CPU}" JLN_CPU)
if(NOT(("default" STREQUAL JLN_CPU) OR ("generic" STREQUAL JLN_CPU) OR ("native" STREQUAL JLN_CPU)))
message(FATAL_ERROR "Unknow value \"${JLN_CPU}\" for JLN_CPU, expected: default, generic, native")
endif()
endif()
set(JLN_DEBUG "${JLN_DEBUG}" CACHE STRING "")
if(NOT("${JLN_DEBUG}" STREQUAL ""))
string(TOLOWER "${JLN_DEBUG}" JLN_DEBUG)
if(NOT(("default" STREQUAL JLN_DEBUG) OR ("off" STREQUAL JLN_DEBUG) OR ("on" STREQUAL JLN_DEBUG) OR ("line_tables_only" STREQUAL JLN_DEBUG) OR ("gdb" STREQUAL JLN_DEBUG) OR ("lldb" STREQUAL JLN_DEBUG) OR ("sce" STREQUAL JLN_DEBUG)))
message(FATAL_ERROR "Unknow value \"${JLN_DEBUG}\" for JLN_DEBUG, expected: default, off, on, line_tables_only, gdb, lldb, sce")
endif()
endif()
set(JLN_DIAGNOSTICS_FORMAT "${JLN_DIAGNOSTICS_FORMAT}" CACHE STRING "")
if(NOT("${JLN_DIAGNOSTICS_FORMAT}" STREQUAL ""))
string(TOLOWER "${JLN_DIAGNOSTICS_FORMAT}" JLN_DIAGNOSTICS_FORMAT)
if(NOT(("default" STREQUAL JLN_DIAGNOSTICS_FORMAT) OR ("fixits" STREQUAL JLN_DIAGNOSTICS_FORMAT) OR ("patch" STREQUAL JLN_DIAGNOSTICS_FORMAT) OR ("print_source_range_info" STREQUAL JLN_DIAGNOSTICS_FORMAT)))
message(FATAL_ERROR "Unknow value \"${JLN_DIAGNOSTICS_FORMAT}\" for JLN_DIAGNOSTICS_FORMAT, expected: default, fixits, patch, print_source_range_info")
endif()
endif()
set(JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE "${JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE}" CACHE STRING "")
if(NOT("${JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE}" STREQUAL ""))
string(TOLOWER "${JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE}" JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE)
if(NOT(("default" STREQUAL JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE) OR ("off" STREQUAL JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE) OR ("on" STREQUAL JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE)))
message(FATAL_ERROR "Unknow value \"${JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE}\" for JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE, expected: default, off, on")
endif()
endif()
set(JLN_ELIDE_TYPE "${JLN_ELIDE_TYPE}" CACHE STRING "")
if(NOT("${JLN_ELIDE_TYPE}" STREQUAL ""))
string(TOLOWER "${JLN_ELIDE_TYPE}" JLN_ELIDE_TYPE)
if(NOT(("default" STREQUAL JLN_ELIDE_TYPE) OR ("off" STREQUAL JLN_ELIDE_TYPE) OR ("on" STREQUAL JLN_ELIDE_TYPE)))
message(FATAL_ERROR "Unknow value \"${JLN_ELIDE_TYPE}\" for JLN_ELIDE_TYPE, expected: default, off, on")
endif()
endif()
set(JLN_EXCEPTIONS "${JLN_EXCEPTIONS}" CACHE STRING "")
if(NOT("${JLN_EXCEPTIONS}" STREQUAL ""))
string(TOLOWER "${JLN_EXCEPTIONS}" JLN_EXCEPTIONS)
if(NOT(("default" STREQUAL JLN_EXCEPTIONS) OR ("off" STREQUAL JLN_EXCEPTIONS) OR ("on" STREQUAL JLN_EXCEPTIONS)))
message(FATAL_ERROR "Unknow value \"${JLN_EXCEPTIONS}\" for JLN_EXCEPTIONS, expected: default, off, on")
endif()
endif()
set(JLN_FIX_COMPILER_ERROR "${JLN_FIX_COMPILER_ERROR}" CACHE STRING "")
if(NOT("${JLN_FIX_COMPILER_ERROR}" STREQUAL ""))
string(TOLOWER "${JLN_FIX_COMPILER_ERROR}" JLN_FIX_COMPILER_ERROR)
if(NOT(("default" STREQUAL JLN_FIX_COMPILER_ERROR) OR ("off" STREQUAL JLN_FIX_COMPILER_ERROR) OR ("on" STREQUAL JLN_FIX_COMPILER_ERROR)))
message(FATAL_ERROR "Unknow value \"${JLN_FIX_COMPILER_ERROR}\" for JLN_FIX_COMPILER_ERROR, expected: default, off, on")
endif()
endif()
set(JLN_LINKER "${JLN_LINKER}" CACHE STRING "")
if(NOT("${JLN_LINKER}" STREQUAL ""))
string(TOLOWER "${JLN_LINKER}" JLN_LINKER)
if(NOT(("default" STREQUAL JLN_LINKER) OR ("bfd" STREQUAL JLN_LINKER) OR ("gold" STREQUAL JLN_LINKER) OR ("lld" STREQUAL JLN_LINKER) OR ("native" STREQUAL JLN_LINKER)))
message(FATAL_ERROR "Unknow value \"${JLN_LINKER}\" for JLN_LINKER, expected: default, bfd, gold, lld, native")
endif()
endif()
set(JLN_LTO "${JLN_LTO}" CACHE STRING "")
if(NOT("${JLN_LTO}" STREQUAL ""))
string(TOLOWER "${JLN_LTO}" JLN_LTO)
if(NOT(("default" STREQUAL JLN_LTO) OR ("off" STREQUAL JLN_LTO) OR ("on" STREQUAL JLN_LTO) OR ("fat" STREQUAL JLN_LTO) OR ("thin" STREQUAL JLN_LTO)))
message(FATAL_ERROR "Unknow value \"${JLN_LTO}\" for JLN_LTO, expected: default, off, on, fat, thin")
endif()
endif()
set(JLN_MSVC_ISYSTEM "${JLN_MSVC_ISYSTEM}" CACHE STRING "")
if(NOT("${JLN_MSVC_ISYSTEM}" STREQUAL ""))
string(TOLOWER "${JLN_MSVC_ISYSTEM}" JLN_MSVC_ISYSTEM)
if(NOT(("default" STREQUAL JLN_MSVC_ISYSTEM) OR ("anglebrackets" STREQUAL JLN_MSVC_ISYSTEM) OR ("include_and_caexcludepath" STREQUAL JLN_MSVC_ISYSTEM)))
message(FATAL_ERROR "Unknow value \"${JLN_MSVC_ISYSTEM}\" for JLN_MSVC_ISYSTEM, expected: default, anglebrackets, include_and_caexcludepath")
endif()
endif()
set(JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL "${JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL}" CACHE STRING "")
if(NOT("${JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL}" STREQUAL ""))
string(TOLOWER "${JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL}" JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL)
if(NOT(("default" STREQUAL JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL) OR ("off" STREQUAL JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL) OR ("on" STREQUAL JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL)))
message(FATAL_ERROR "Unknow value \"${JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL}\" for JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL, expected: default, off, on")
endif()
endif()
set(JLN_OPTIMIZATION "${JLN_OPTIMIZATION}" CACHE STRING "")
if(NOT("${JLN_OPTIMIZATION}" STREQUAL ""))
string(TOLOWER "${JLN_OPTIMIZATION}" JLN_OPTIMIZATION)
if(NOT(("default" STREQUAL JLN_OPTIMIZATION) OR ("0" STREQUAL JLN_OPTIMIZATION) OR ("g" STREQUAL JLN_OPTIMIZATION) OR ("1" STREQUAL JLN_OPTIMIZATION) OR ("2" STREQUAL JLN_OPTIMIZATION) OR ("3" STREQUAL JLN_OPTIMIZATION) OR ("fast" STREQUAL JLN_OPTIMIZATION) OR ("size" STREQUAL JLN_OPTIMIZATION)))
message(FATAL_ERROR "Unknow value \"${JLN_OPTIMIZATION}\" for JLN_OPTIMIZATION, expected: default, 0, g, 1, 2, 3, fast, size")
endif()
endif()
set(JLN_PEDANTIC "${JLN_PEDANTIC}" CACHE STRING "")
if(NOT("${JLN_PEDANTIC}" STREQUAL ""))
string(TOLOWER "${JLN_PEDANTIC}" JLN_PEDANTIC)
if(NOT(("default" STREQUAL JLN_PEDANTIC) OR ("off" STREQUAL JLN_PEDANTIC) OR ("on" STREQUAL JLN_PEDANTIC) OR ("as_error" STREQUAL JLN_PEDANTIC)))
message(FATAL_ERROR "Unknow value \"${JLN_PEDANTIC}\" for JLN_PEDANTIC, expected: default, off, on, as_error")
endif()
endif()
set(JLN_PIE "${JLN_PIE}" CACHE STRING "")
if(NOT("${JLN_PIE}" STREQUAL ""))
string(TOLOWER "${JLN_PIE}" JLN_PIE)
if(NOT(("default" STREQUAL JLN_PIE) OR ("off" STREQUAL JLN_PIE) OR ("on" STREQUAL JLN_PIE) OR ("pic" STREQUAL JLN_PIE)))
message(FATAL_ERROR "Unknow value \"${JLN_PIE}\" for JLN_PIE, expected: default, off, on, pic")
endif()
endif()
set(JLN_RELRO "${JLN_RELRO}" CACHE STRING "")
if(NOT("${JLN_RELRO}" STREQUAL ""))
string(TOLOWER "${JLN_RELRO}" JLN_RELRO)
if(NOT(("default" STREQUAL JLN_RELRO) OR ("off" STREQUAL JLN_RELRO) OR ("on" STREQUAL JLN_RELRO) OR ("full" STREQUAL JLN_RELRO)))
message(FATAL_ERROR "Unknow value \"${JLN_RELRO}\" for JLN_RELRO, expected: default, off, on, full")
endif()
endif()
set(JLN_REPRODUCIBLE_BUILD_WARNINGS "${JLN_REPRODUCIBLE_BUILD_WARNINGS}" CACHE STRING "")
if(NOT("${JLN_REPRODUCIBLE_BUILD_WARNINGS}" STREQUAL ""))
string(TOLOWER "${JLN_REPRODUCIBLE_BUILD_WARNINGS}" JLN_REPRODUCIBLE_BUILD_WARNINGS)
if(NOT(("default" STREQUAL JLN_REPRODUCIBLE_BUILD_WARNINGS) OR ("off" STREQUAL JLN_REPRODUCIBLE_BUILD_WARNINGS) OR ("on" STREQUAL JLN_REPRODUCIBLE_BUILD_WARNINGS)))
message(FATAL_ERROR "Unknow value \"${JLN_REPRODUCIBLE_BUILD_WARNINGS}\" for JLN_REPRODUCIBLE_BUILD_WARNINGS, expected: default, off, on")
endif()
endif()
set(JLN_RTTI "${JLN_RTTI}" CACHE STRING "")
if(NOT("${JLN_RTTI}" STREQUAL ""))
string(TOLOWER "${JLN_RTTI}" JLN_RTTI)
if(NOT(("default" STREQUAL JLN_RTTI) OR ("off" STREQUAL JLN_RTTI) OR ("on" STREQUAL JLN_RTTI)))
message(FATAL_ERROR "Unknow value \"${JLN_RTTI}\" for JLN_RTTI, expected: default, off, on")
endif()
endif()
set(JLN_SANITIZERS "${JLN_SANITIZERS}" CACHE STRING "")
if(NOT("${JLN_SANITIZERS}" STREQUAL ""))
string(TOLOWER "${JLN_SANITIZERS}" JLN_SANITIZERS)
if(NOT(("default" STREQUAL JLN_SANITIZERS) OR ("off" STREQUAL JLN_SANITIZERS) OR ("on" STREQUAL JLN_SANITIZERS)))
message(FATAL_ERROR "Unknow value \"${JLN_SANITIZERS}\" for JLN_SANITIZERS, expected: default, off, on")
endif()
endif()
set(JLN_SANITIZERS_EXTRA "${JLN_SANITIZERS_EXTRA}" CACHE STRING "")
if(NOT("${JLN_SANITIZERS_EXTRA}" STREQUAL ""))
string(TOLOWER "${JLN_SANITIZERS_EXTRA}" JLN_SANITIZERS_EXTRA)
if(NOT(("default" STREQUAL JLN_SANITIZERS_EXTRA) OR ("off" STREQUAL JLN_SANITIZERS_EXTRA) OR ("thread" STREQUAL JLN_SANITIZERS_EXTRA) OR ("pointer" STREQUAL JLN_SANITIZERS_EXTRA)))
message(FATAL_ERROR "Unknow value \"${JLN_SANITIZERS_EXTRA}\" for JLN_SANITIZERS_EXTRA, expected: default, off, thread, pointer")
endif()
endif()
set(JLN_SHADOW_WARNINGS "${JLN_SHADOW_WARNINGS}" CACHE STRING "")
if(NOT("${JLN_SHADOW_WARNINGS}" STREQUAL ""))
string(TOLOWER "${JLN_SHADOW_WARNINGS}" JLN_SHADOW_WARNINGS)
if(NOT(("default" STREQUAL JLN_SHADOW_WARNINGS) OR ("off" STREQUAL JLN_SHADOW_WARNINGS) OR ("on" STREQUAL JLN_SHADOW_WARNINGS) OR ("local" STREQUAL JLN_SHADOW_WARNINGS) OR ("compatible_local" STREQUAL JLN_SHADOW_WARNINGS) OR ("all" STREQUAL JLN_SHADOW_WARNINGS)))
message(FATAL_ERROR "Unknow value \"${JLN_SHADOW_WARNINGS}\" for JLN_SHADOW_WARNINGS, expected: default, off, on, local, compatible_local, all")
endif()
endif()
set(JLN_STACK_PROTECTOR "${JLN_STACK_PROTECTOR}" CACHE STRING "")
if(NOT("${JLN_STACK_PROTECTOR}" STREQUAL ""))
string(TOLOWER "${JLN_STACK_PROTECTOR}" JLN_STACK_PROTECTOR)
if(NOT(("default" STREQUAL JLN_STACK_PROTECTOR) OR ("off" STREQUAL JLN_STACK_PROTECTOR) OR ("on" STREQUAL JLN_STACK_PROTECTOR) OR ("strong" STREQUAL JLN_STACK_PROTECTOR) OR ("all" STREQUAL JLN_STACK_PROTECTOR)))
message(FATAL_ERROR "Unknow value \"${JLN_STACK_PROTECTOR}\" for JLN_STACK_PROTECTOR, expected: default, off, on, strong, all")
endif()
endif()
set(JLN_STL_DEBUG "${JLN_STL_DEBUG}" CACHE STRING "")
if(NOT("${JLN_STL_DEBUG}" STREQUAL ""))
string(TOLOWER "${JLN_STL_DEBUG}" JLN_STL_DEBUG)
if(NOT(("default" STREQUAL JLN_STL_DEBUG) OR ("off" STREQUAL JLN_STL_DEBUG) OR ("on" STREQUAL JLN_STL_DEBUG) OR ("allow_broken_abi" STREQUAL JLN_STL_DEBUG) OR ("allow_broken_abi_and_bugs" STREQUAL JLN_STL_DEBUG) OR ("assert_as_exception" STREQUAL JLN_STL_DEBUG)))
message(FATAL_ERROR "Unknow value \"${JLN_STL_DEBUG}\" for JLN_STL_DEBUG, expected: default, off, on, allow_broken_abi, allow_broken_abi_and_bugs, assert_as_exception")
endif()
endif()
set(JLN_STL_FIX "${JLN_STL_FIX}" CACHE STRING "")
if(NOT("${JLN_STL_FIX}" STREQUAL ""))
string(TOLOWER "${JLN_STL_FIX}" JLN_STL_FIX)
if(NOT(("default" STREQUAL JLN_STL_FIX) OR ("off" STREQUAL JLN_STL_FIX) OR ("on" STREQUAL JLN_STL_FIX)))
message(FATAL_ERROR "Unknow value \"${JLN_STL_FIX}\" for JLN_STL_FIX, expected: default, off, on")
endif()
endif()
set(JLN_SUGGESTIONS "${JLN_SUGGESTIONS}" CACHE STRING "")
if(NOT("${JLN_SUGGESTIONS}" STREQUAL ""))
string(TOLOWER "${JLN_SUGGESTIONS}" JLN_SUGGESTIONS)
if(NOT(("default" STREQUAL JLN_SUGGESTIONS) OR ("off" STREQUAL JLN_SUGGESTIONS) OR ("on" STREQUAL JLN_SUGGESTIONS)))
message(FATAL_ERROR "Unknow value \"${JLN_SUGGESTIONS}\" for JLN_SUGGESTIONS, expected: default, off, on")
endif()
endif()
set(JLN_WARNINGS "${JLN_WARNINGS}" CACHE STRING "")
if(NOT("${JLN_WARNINGS}" STREQUAL ""))
string(TOLOWER "${JLN_WARNINGS}" JLN_WARNINGS)
if(NOT(("default" STREQUAL JLN_WARNINGS) OR ("off" STREQUAL JLN_WARNINGS) OR ("on" STREQUAL JLN_WARNINGS) OR ("strict" STREQUAL JLN_WARNINGS) OR ("very_strict" STREQUAL JLN_WARNINGS)))
message(FATAL_ERROR "Unknow value \"${JLN_WARNINGS}\" for JLN_WARNINGS, expected: default, off, on, strict, very_strict")
endif()
endif()
set(JLN_WARNINGS_AS_ERROR "${JLN_WARNINGS_AS_ERROR}" CACHE STRING "")
if(NOT("${JLN_WARNINGS_AS_ERROR}" STREQUAL ""))
string(TOLOWER "${JLN_WARNINGS_AS_ERROR}" JLN_WARNINGS_AS_ERROR)
if(NOT(("default" STREQUAL JLN_WARNINGS_AS_ERROR) OR ("off" STREQUAL JLN_WARNINGS_AS_ERROR) OR ("on" STREQUAL JLN_WARNINGS_AS_ERROR) OR ("basic" STREQUAL JLN_WARNINGS_AS_ERROR)))
message(FATAL_ERROR "Unknow value \"${JLN_WARNINGS_AS_ERROR}\" for JLN_WARNINGS_AS_ERROR, expected: default, off, on, basic")
endif()
endif()
set(JLN_WHOLE_PROGRAM "${JLN_WHOLE_PROGRAM}" CACHE STRING "")
if(NOT("${JLN_WHOLE_PROGRAM}" STREQUAL ""))
string(TOLOWER "${JLN_WHOLE_PROGRAM}" JLN_WHOLE_PROGRAM)
if(NOT(("default" STREQUAL JLN_WHOLE_PROGRAM) OR ("off" STREQUAL JLN_WHOLE_PROGRAM) OR ("on" STREQUAL JLN_WHOLE_PROGRAM) OR ("strip_all" STREQUAL JLN_WHOLE_PROGRAM)))
message(FATAL_ERROR "Unknow value \"${JLN_WHOLE_PROGRAM}\" for JLN_WHOLE_PROGRAM, expected: default, off, on, strip_all")
endif()
endif()
set(JLN_VERBOSE ${JLN_VERBOSE} CACHE STRING "")
set(JLN_AUTO_PROFILE ${JLN_AUTO_PROFILE} CACHE STRING "")
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(_JLN_BUILD_TYPE "Debug")
set(_JLN_BUILD_TYPE_PARSER "Debug")
else()
set(_JLN_BUILD_TYPE ${CMAKE_BUILD_TYPE})
string(TOLOWER ${CMAKE_BUILD_TYPE} _JLN_BUILD_TYPE_PARSER)
endif()
function(jln_parse_arguments prefix one_value_keywords)
if(${ARGC} LESS 3)
return()
endif()
set(SAME_BUILD_TYPE 1)
foreach(ival RANGE 3 ${ARGC} 2)
math(EXPR i ${ival}-1)
set(name ${ARGV${i}})
if(${name} STREQUAL "BUILD_TYPE")
string(TOLOWER "${ARGV${ival}}" type)
if(${_JLN_BUILD_TYPE_PARSER} STREQUAL "${type}")
set(SAME_BUILD_TYPE 1)
else()
set(SAME_BUILD_TYPE 0)
endif()
else()
list(FIND one_value_keywords "${name}" INDEX)
if(${INDEX} EQUAL -1)
message(FATAL_ERROR "Unknown '${name}' parameter")
endif()
set(value "${ARGV${ival}}")
string(TOLOWER "${value}" lowercase_value)
list(FIND _JLN_${name}_VALUES "${lowercase_value}" INDEX)
if(${INDEX} EQUAL -1)
if(${name} STREQUAL "CXX_VAR" OR ${name} STREQUAL "LINK_VAR")
if(SAME_BUILD_TYPE)
set("${prefix}_${name}" ${value} PARENT_SCOPE)
endif()
else()
list(JOIN _JLN_${name}_VALUES ", " values)
message(FATAL_ERROR "Parameter '${name}': Unknown '${value}', expected: ${values}")
endif()
elseif(SAME_BUILD_TYPE)
set("${prefix}_${name}" ${lowercase_value} PARENT_SCOPE)
endif()
endif()
endforeach()
endfunction()
set(JLN_CXX_IS_INITIALIZED 0 CACHE BOOL "private" FORCE)
# init default values
# jln_init_flags([<jln-option> <default_value>]... [AUTO_PROFILE on] [VERBOSE on] [BUILD_TYPE type conditioned-options])
# AUTO_PROFILE: enables options based on CMAKE_BUILD_TYPE (assumes "Debug" if CMAKE_BUILD_TYPE is empty)
# BUILD_TYPE: enables following options only if ${CMAKE_BUILD_TYPE} has the same value (CMAKE_BUILD_TYPE assumed to Debug if empty)
# Example:
# jln_init_flags(
# SUGGESTIONS on
#
# BUILD_TYPE debug SANITIZERS on
# BUILD_TYPE release LTO on
# )
function(jln_init_flags)
jln_parse_arguments(JLN_DEFAULT_FLAG "VERBOSE;COLOR;CONTROL_FLOW;COVERAGE;CPU;DEBUG;DIAGNOSTICS_FORMAT;DIAGNOSTICS_SHOW_TEMPLATE_TREE;ELIDE_TYPE;EXCEPTIONS;FIX_COMPILER_ERROR;LINKER;LTO;MSVC_ISYSTEM;MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL;OPTIMIZATION;PEDANTIC;PIE;RELRO;REPRODUCIBLE_BUILD_WARNINGS;RTTI;SANITIZERS;SANITIZERS_EXTRA;SHADOW_WARNINGS;STACK_PROTECTOR;STL_DEBUG;STL_FIX;SUGGESTIONS;WARNINGS;WARNINGS_AS_ERROR;WHOLE_PROGRAM;AUTO_PROFILE" ${ARGN})
if(DEFINED JLN_DEFAULT_FLAG_VERBOSE)
set(JLN_VERBOSE_D ${JLN_DEFAULT_FLAG_VERBOSE})
elseif("${JLN_VERBOSE}" STREQUAL "")
set(JLN_VERBOSE_D "")
else()
string(TOLOWER "${JLN_VERBOSE}" JLN_VERBOSE_D)
endif()
if(DEFINED JLN_DEFAULT_FLAG_AUTO_PROFILE)
set(JLN_AUTO_PROFILE_D ${JLN_DEFAULT_FLAG_AUTO_PROFILE})
elseif("${JLN_AUTO_PROFILE}" STREQUAL "")
set(JLN_AUTO_PROFILE_D "")
else()
string(TOLOWER "${JLN_AUTO_PROFILE}" JLN_AUTO_PROFILE_D)
endif()
if("${JLN_AUTO_PROFILE_D}" STREQUAL "on")
if("Debug" STREQUAL "${_JLN_BUILD_TYPE}")
if(NOT DEFINED JLN_DEFAULT_FLAG_CONTROL_FLOW)
set(JLN_DEFAULT_FLAG_CONTROL_FLOW "on")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_DEBUG)
set(JLN_DEFAULT_FLAG_DEBUG "on")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_SANITIZERS)
set(JLN_DEFAULT_FLAG_SANITIZERS "on")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_STL_DEBUG)
set(JLN_DEFAULT_FLAG_STL_DEBUG "on")
endif()
endif()
if("RelWithDebInfo" STREQUAL "${_JLN_BUILD_TYPE}")
if(NOT DEFINED JLN_DEFAULT_FLAG_DEBUG)
set(JLN_DEFAULT_FLAG_DEBUG "on")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_LINKER)
set(JLN_DEFAULT_FLAG_LINKER "native")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_LTO)
set(JLN_DEFAULT_FLAG_LTO "on")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_OPTIMIZATION)
set(JLN_DEFAULT_FLAG_OPTIMIZATION "g")
endif()
endif()
if("MinSizeRel" STREQUAL "${_JLN_BUILD_TYPE}")
if(NOT DEFINED JLN_DEFAULT_FLAG_CPU)
set(JLN_DEFAULT_FLAG_CPU "native")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_LINKER)
set(JLN_DEFAULT_FLAG_LINKER "native")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_LTO)
set(JLN_DEFAULT_FLAG_LTO "on")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_OPTIMIZATION)
set(JLN_DEFAULT_FLAG_OPTIMIZATION "size")
endif()
endif()
if("Release" STREQUAL "${_JLN_BUILD_TYPE}")
if(NOT DEFINED JLN_DEFAULT_FLAG_CPU)
set(JLN_DEFAULT_FLAG_CPU "native")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_LINKER)
set(JLN_DEFAULT_FLAG_LINKER "native")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_LTO)
set(JLN_DEFAULT_FLAG_LTO "on")
endif()
if(NOT DEFINED JLN_DEFAULT_FLAG_OPTIMIZATION)
set(JLN_DEFAULT_FLAG_OPTIMIZATION "2")
endif()
endif()
endif()
if(DEFINED JLN_DEFAULT_FLAG_COLOR)
set(JLN_COLOR_D ${JLN_DEFAULT_FLAG_COLOR} CACHE STRING "private" FORCE)
elseif("${JLN_COLOR}" STREQUAL "")
set(JLN_COLOR_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_COLOR_D "${JLN_COLOR}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_CONTROL_FLOW)
set(JLN_CONTROL_FLOW_D ${JLN_DEFAULT_FLAG_CONTROL_FLOW} CACHE STRING "private" FORCE)
elseif("${JLN_CONTROL_FLOW}" STREQUAL "")
set(JLN_CONTROL_FLOW_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_CONTROL_FLOW_D "${JLN_CONTROL_FLOW}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_COVERAGE)
set(JLN_COVERAGE_D ${JLN_DEFAULT_FLAG_COVERAGE} CACHE STRING "private" FORCE)
elseif("${JLN_COVERAGE}" STREQUAL "")
set(JLN_COVERAGE_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_COVERAGE_D "${JLN_COVERAGE}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_CPU)
set(JLN_CPU_D ${JLN_DEFAULT_FLAG_CPU} CACHE STRING "private" FORCE)
elseif("${JLN_CPU}" STREQUAL "")
set(JLN_CPU_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_CPU_D "${JLN_CPU}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_DEBUG)
set(JLN_DEBUG_D ${JLN_DEFAULT_FLAG_DEBUG} CACHE STRING "private" FORCE)
elseif("${JLN_DEBUG}" STREQUAL "")
set(JLN_DEBUG_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_DEBUG_D "${JLN_DEBUG}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_DIAGNOSTICS_FORMAT)
set(JLN_DIAGNOSTICS_FORMAT_D ${JLN_DEFAULT_FLAG_DIAGNOSTICS_FORMAT} CACHE STRING "private" FORCE)
elseif("${JLN_DIAGNOSTICS_FORMAT}" STREQUAL "")
set(JLN_DIAGNOSTICS_FORMAT_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_DIAGNOSTICS_FORMAT_D "${JLN_DIAGNOSTICS_FORMAT}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_DIAGNOSTICS_SHOW_TEMPLATE_TREE)
set(JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE_D ${JLN_DEFAULT_FLAG_DIAGNOSTICS_SHOW_TEMPLATE_TREE} CACHE STRING "private" FORCE)
elseif("${JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE}" STREQUAL "")
set(JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE_D "${JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_ELIDE_TYPE)
set(JLN_ELIDE_TYPE_D ${JLN_DEFAULT_FLAG_ELIDE_TYPE} CACHE STRING "private" FORCE)
elseif("${JLN_ELIDE_TYPE}" STREQUAL "")
set(JLN_ELIDE_TYPE_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_ELIDE_TYPE_D "${JLN_ELIDE_TYPE}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_EXCEPTIONS)
set(JLN_EXCEPTIONS_D ${JLN_DEFAULT_FLAG_EXCEPTIONS} CACHE STRING "private" FORCE)
elseif("${JLN_EXCEPTIONS}" STREQUAL "")
set(JLN_EXCEPTIONS_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_EXCEPTIONS_D "${JLN_EXCEPTIONS}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_FIX_COMPILER_ERROR)
set(JLN_FIX_COMPILER_ERROR_D ${JLN_DEFAULT_FLAG_FIX_COMPILER_ERROR} CACHE STRING "private" FORCE)
elseif("${JLN_FIX_COMPILER_ERROR}" STREQUAL "")
set(JLN_FIX_COMPILER_ERROR_D "on" CACHE STRING "private" FORCE)
else()
set(JLN_FIX_COMPILER_ERROR_D "${JLN_FIX_COMPILER_ERROR}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_LINKER)
set(JLN_LINKER_D ${JLN_DEFAULT_FLAG_LINKER} CACHE STRING "private" FORCE)
elseif("${JLN_LINKER}" STREQUAL "")
set(JLN_LINKER_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_LINKER_D "${JLN_LINKER}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_LTO)
set(JLN_LTO_D ${JLN_DEFAULT_FLAG_LTO} CACHE STRING "private" FORCE)
elseif("${JLN_LTO}" STREQUAL "")
set(JLN_LTO_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_LTO_D "${JLN_LTO}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_MSVC_ISYSTEM)
set(JLN_MSVC_ISYSTEM_D ${JLN_DEFAULT_FLAG_MSVC_ISYSTEM} CACHE STRING "private" FORCE)
elseif("${JLN_MSVC_ISYSTEM}" STREQUAL "")
set(JLN_MSVC_ISYSTEM_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_MSVC_ISYSTEM_D "${JLN_MSVC_ISYSTEM}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL)
set(JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL_D ${JLN_DEFAULT_FLAG_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL} CACHE STRING "private" FORCE)
elseif("${JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL}" STREQUAL "")
set(JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL_D "${JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_OPTIMIZATION)
set(JLN_OPTIMIZATION_D ${JLN_DEFAULT_FLAG_OPTIMIZATION} CACHE STRING "private" FORCE)
elseif("${JLN_OPTIMIZATION}" STREQUAL "")
set(JLN_OPTIMIZATION_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_OPTIMIZATION_D "${JLN_OPTIMIZATION}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_PEDANTIC)
set(JLN_PEDANTIC_D ${JLN_DEFAULT_FLAG_PEDANTIC} CACHE STRING "private" FORCE)
elseif("${JLN_PEDANTIC}" STREQUAL "")
set(JLN_PEDANTIC_D "on" CACHE STRING "private" FORCE)
else()
set(JLN_PEDANTIC_D "${JLN_PEDANTIC}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_PIE)
set(JLN_PIE_D ${JLN_DEFAULT_FLAG_PIE} CACHE STRING "private" FORCE)
elseif("${JLN_PIE}" STREQUAL "")
set(JLN_PIE_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_PIE_D "${JLN_PIE}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_RELRO)
set(JLN_RELRO_D ${JLN_DEFAULT_FLAG_RELRO} CACHE STRING "private" FORCE)
elseif("${JLN_RELRO}" STREQUAL "")
set(JLN_RELRO_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_RELRO_D "${JLN_RELRO}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_REPRODUCIBLE_BUILD_WARNINGS)
set(JLN_REPRODUCIBLE_BUILD_WARNINGS_D ${JLN_DEFAULT_FLAG_REPRODUCIBLE_BUILD_WARNINGS} CACHE STRING "private" FORCE)
elseif("${JLN_REPRODUCIBLE_BUILD_WARNINGS}" STREQUAL "")
set(JLN_REPRODUCIBLE_BUILD_WARNINGS_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_REPRODUCIBLE_BUILD_WARNINGS_D "${JLN_REPRODUCIBLE_BUILD_WARNINGS}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_RTTI)
set(JLN_RTTI_D ${JLN_DEFAULT_FLAG_RTTI} CACHE STRING "private" FORCE)
elseif("${JLN_RTTI}" STREQUAL "")
set(JLN_RTTI_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_RTTI_D "${JLN_RTTI}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_SANITIZERS)
set(JLN_SANITIZERS_D ${JLN_DEFAULT_FLAG_SANITIZERS} CACHE STRING "private" FORCE)
elseif("${JLN_SANITIZERS}" STREQUAL "")
set(JLN_SANITIZERS_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_SANITIZERS_D "${JLN_SANITIZERS}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_SANITIZERS_EXTRA)
set(JLN_SANITIZERS_EXTRA_D ${JLN_DEFAULT_FLAG_SANITIZERS_EXTRA} CACHE STRING "private" FORCE)
elseif("${JLN_SANITIZERS_EXTRA}" STREQUAL "")
set(JLN_SANITIZERS_EXTRA_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_SANITIZERS_EXTRA_D "${JLN_SANITIZERS_EXTRA}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_SHADOW_WARNINGS)
set(JLN_SHADOW_WARNINGS_D ${JLN_DEFAULT_FLAG_SHADOW_WARNINGS} CACHE STRING "private" FORCE)
elseif("${JLN_SHADOW_WARNINGS}" STREQUAL "")
set(JLN_SHADOW_WARNINGS_D "off" CACHE STRING "private" FORCE)
else()
set(JLN_SHADOW_WARNINGS_D "${JLN_SHADOW_WARNINGS}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_STACK_PROTECTOR)
set(JLN_STACK_PROTECTOR_D ${JLN_DEFAULT_FLAG_STACK_PROTECTOR} CACHE STRING "private" FORCE)
elseif("${JLN_STACK_PROTECTOR}" STREQUAL "")
set(JLN_STACK_PROTECTOR_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_STACK_PROTECTOR_D "${JLN_STACK_PROTECTOR}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_STL_DEBUG)
set(JLN_STL_DEBUG_D ${JLN_DEFAULT_FLAG_STL_DEBUG} CACHE STRING "private" FORCE)
elseif("${JLN_STL_DEBUG}" STREQUAL "")
set(JLN_STL_DEBUG_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_STL_DEBUG_D "${JLN_STL_DEBUG}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_STL_FIX)
set(JLN_STL_FIX_D ${JLN_DEFAULT_FLAG_STL_FIX} CACHE STRING "private" FORCE)
elseif("${JLN_STL_FIX}" STREQUAL "")
set(JLN_STL_FIX_D "on" CACHE STRING "private" FORCE)
else()
set(JLN_STL_FIX_D "${JLN_STL_FIX}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_SUGGESTIONS)
set(JLN_SUGGESTIONS_D ${JLN_DEFAULT_FLAG_SUGGESTIONS} CACHE STRING "private" FORCE)
elseif("${JLN_SUGGESTIONS}" STREQUAL "")
set(JLN_SUGGESTIONS_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_SUGGESTIONS_D "${JLN_SUGGESTIONS}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_WARNINGS)
set(JLN_WARNINGS_D ${JLN_DEFAULT_FLAG_WARNINGS} CACHE STRING "private" FORCE)
elseif("${JLN_WARNINGS}" STREQUAL "")
set(JLN_WARNINGS_D "on" CACHE STRING "private" FORCE)
else()
set(JLN_WARNINGS_D "${JLN_WARNINGS}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_WARNINGS_AS_ERROR)
set(JLN_WARNINGS_AS_ERROR_D ${JLN_DEFAULT_FLAG_WARNINGS_AS_ERROR} CACHE STRING "private" FORCE)
elseif("${JLN_WARNINGS_AS_ERROR}" STREQUAL "")
set(JLN_WARNINGS_AS_ERROR_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_WARNINGS_AS_ERROR_D "${JLN_WARNINGS_AS_ERROR}" CACHE STRING "private" FORCE)
endif()
if(DEFINED JLN_DEFAULT_FLAG_WHOLE_PROGRAM)
set(JLN_WHOLE_PROGRAM_D ${JLN_DEFAULT_FLAG_WHOLE_PROGRAM} CACHE STRING "private" FORCE)
elseif("${JLN_WHOLE_PROGRAM}" STREQUAL "")
set(JLN_WHOLE_PROGRAM_D "default" CACHE STRING "private" FORCE)
else()
set(JLN_WHOLE_PROGRAM_D "${JLN_WHOLE_PROGRAM}" CACHE STRING "private" FORCE)
endif()
if("${JLN_VERBOSE_D}" STREQUAL "on" OR "${JLN_VERBOSE_D}" STREQUAL "1")
message(STATUS "JLN_AUTO_PROFILE = ${JLN_AUTO_PROFILE_D} [off, on]")
message(STATUS "JLN_COLOR = ${JLN_COLOR_D} [default, auto, never, always]")
message(STATUS "JLN_CONTROL_FLOW = ${JLN_CONTROL_FLOW_D} [default, off, on, branch, return, allow_bugs]")
message(STATUS "JLN_COVERAGE = ${JLN_COVERAGE_D} [default, off, on]")
message(STATUS "JLN_CPU = ${JLN_CPU_D} [default, generic, native]")
message(STATUS "JLN_DEBUG = ${JLN_DEBUG_D} [default, off, on, line_tables_only, gdb, lldb, sce]")
message(STATUS "JLN_DIAGNOSTICS_FORMAT = ${JLN_DIAGNOSTICS_FORMAT_D} [default, fixits, patch, print_source_range_info]")
message(STATUS "JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE = ${JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE_D} [default, off, on]")
message(STATUS "JLN_ELIDE_TYPE = ${JLN_ELIDE_TYPE_D} [default, off, on]")
message(STATUS "JLN_EXCEPTIONS = ${JLN_EXCEPTIONS_D} [default, off, on]")
message(STATUS "JLN_FIX_COMPILER_ERROR = ${JLN_FIX_COMPILER_ERROR_D} [default, off, on]")
message(STATUS "JLN_LINKER = ${JLN_LINKER_D} [default, bfd, gold, lld, native]")
message(STATUS "JLN_LTO = ${JLN_LTO_D} [default, off, on, fat, thin]")
message(STATUS "JLN_MSVC_ISYSTEM = ${JLN_MSVC_ISYSTEM_D} [default, anglebrackets, include_and_caexcludepath]")
message(STATUS "JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL = ${JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL_D} [default, off, on]")
message(STATUS "JLN_OPTIMIZATION = ${JLN_OPTIMIZATION_D} [default, 0, g, 1, 2, 3, fast, size]")
message(STATUS "JLN_PEDANTIC = ${JLN_PEDANTIC_D} [default, off, on, as_error]")
message(STATUS "JLN_PIE = ${JLN_PIE_D} [default, off, on, pic]")
message(STATUS "JLN_RELRO = ${JLN_RELRO_D} [default, off, on, full]")
message(STATUS "JLN_REPRODUCIBLE_BUILD_WARNINGS = ${JLN_REPRODUCIBLE_BUILD_WARNINGS_D} [default, off, on]")
message(STATUS "JLN_RTTI = ${JLN_RTTI_D} [default, off, on]")
message(STATUS "JLN_SANITIZERS = ${JLN_SANITIZERS_D} [default, off, on]")
message(STATUS "JLN_SANITIZERS_EXTRA = ${JLN_SANITIZERS_EXTRA_D} [default, off, thread, pointer]")
message(STATUS "JLN_SHADOW_WARNINGS = ${JLN_SHADOW_WARNINGS_D} [default, off, on, local, compatible_local, all]")
message(STATUS "JLN_STACK_PROTECTOR = ${JLN_STACK_PROTECTOR_D} [default, off, on, strong, all]")
message(STATUS "JLN_STL_DEBUG = ${JLN_STL_DEBUG_D} [default, off, on, allow_broken_abi, allow_broken_abi_and_bugs, assert_as_exception]")
message(STATUS "JLN_STL_FIX = ${JLN_STL_FIX_D} [default, off, on]")
message(STATUS "JLN_SUGGESTIONS = ${JLN_SUGGESTIONS_D} [default, off, on]")
message(STATUS "JLN_WARNINGS = ${JLN_WARNINGS_D} [default, off, on, strict, very_strict]")
message(STATUS "JLN_WARNINGS_AS_ERROR = ${JLN_WARNINGS_AS_ERROR_D} [default, off, on, basic]")
message(STATUS "JLN_WHOLE_PROGRAM = ${JLN_WHOLE_PROGRAM_D} [default, off, on, strip_all]")
endif()
set(JLN_CXX_IS_INITIALIZED 1 CACHE BOOL "private" FORCE)
endfunction()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(JLN_GCC_CXX_COMPILER 1)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
if(MSVC)
set(JLN_CLANG_CL_CXX_COMPILER 1)
else()
set(JLN_CLANG_CXX_COMPILER 1)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(JLN_MSVC_CXX_COMPILER 1)
endif()
if(CMAKE_HOST_APPLE)
set(JLN_LD64_CXX_LINKER 1)
elseif(CMAKE_LINKER MATCHES "lld-link")
set(JLN_LLD_LINK_CXX_LINKER 1)
endif()
# jln_target_interface(<libname> {INTERFACE|PUBLIC|PRIVATE} [<jln-option> <value>]... [DISABLE_OTHERS on|off] [BUILD_TYPE type])
# BUILD_TYPE: enables following options only if ${CMAKE_BUILD_TYPE} has the same value (CMAKE_BUILD_TYPE assumed to Debug if empty)
function(jln_target_interface name type)
jln_flags(CXX_VAR cxx LINK_VAR link ${ARGN})
add_library(${name} ${type})
target_link_options(${name} ${type} ${link})
target_compile_options(${name} ${type} ${cxx})
endfunction()
# jln_flags(CXX_VAR <out-variable> LINK_VAR <out-variable> [<jln-option> <value>]... [DISABLE_OTHERS on|off] [BUILD_TYPE type])
# BUILD_TYPE: enables following options only if ${CMAKE_BUILD_TYPE} has the same value (CMAKE_BUILD_TYPE assumed to Debug if empty)
function(jln_flags)
if(NOT JLN_CXX_IS_INITIALIZED)
jln_init_flags()
endif()
set(CXX_FLAGS "")
set(LINK_LINK "")
jln_parse_arguments(JLN_FLAGS "DISABLE_OTHERS;CXX_VAR;LINK_VAR;COLOR;CONTROL_FLOW;COVERAGE;CPU;DEBUG;DIAGNOSTICS_FORMAT;DIAGNOSTICS_SHOW_TEMPLATE_TREE;ELIDE_TYPE;EXCEPTIONS;FIX_COMPILER_ERROR;LINKER;LTO;MSVC_ISYSTEM;MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL;OPTIMIZATION;PEDANTIC;PIE;RELRO;REPRODUCIBLE_BUILD_WARNINGS;RTTI;SANITIZERS;SANITIZERS_EXTRA;SHADOW_WARNINGS;STACK_PROTECTOR;STL_DEBUG;STL_FIX;SUGGESTIONS;WARNINGS;WARNINGS_AS_ERROR;WHOLE_PROGRAM" ${ARGN})
if(NOT DEFINED JLN_FLAGS_COLOR)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_COLOR "default")
else()
set(JLN_FLAGS_COLOR "${JLN_COLOR_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_CONTROL_FLOW)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_CONTROL_FLOW "default")
else()
set(JLN_FLAGS_CONTROL_FLOW "${JLN_CONTROL_FLOW_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_COVERAGE)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_COVERAGE "default")
else()
set(JLN_FLAGS_COVERAGE "${JLN_COVERAGE_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_CPU)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_CPU "default")
else()
set(JLN_FLAGS_CPU "${JLN_CPU_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_DEBUG)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_DEBUG "default")
else()
set(JLN_FLAGS_DEBUG "${JLN_DEBUG_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_DIAGNOSTICS_FORMAT)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_DIAGNOSTICS_FORMAT "default")
else()
set(JLN_FLAGS_DIAGNOSTICS_FORMAT "${JLN_DIAGNOSTICS_FORMAT_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_DIAGNOSTICS_SHOW_TEMPLATE_TREE)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_DIAGNOSTICS_SHOW_TEMPLATE_TREE "default")
else()
set(JLN_FLAGS_DIAGNOSTICS_SHOW_TEMPLATE_TREE "${JLN_DIAGNOSTICS_SHOW_TEMPLATE_TREE_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_ELIDE_TYPE)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_ELIDE_TYPE "default")
else()
set(JLN_FLAGS_ELIDE_TYPE "${JLN_ELIDE_TYPE_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_EXCEPTIONS)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_EXCEPTIONS "default")
else()
set(JLN_FLAGS_EXCEPTIONS "${JLN_EXCEPTIONS_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_FIX_COMPILER_ERROR)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_FIX_COMPILER_ERROR "on")
else()
set(JLN_FLAGS_FIX_COMPILER_ERROR "${JLN_FIX_COMPILER_ERROR_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_LINKER)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_LINKER "default")
else()
set(JLN_FLAGS_LINKER "${JLN_LINKER_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_LTO)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_LTO "default")
else()
set(JLN_FLAGS_LTO "${JLN_LTO_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_MSVC_ISYSTEM)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_MSVC_ISYSTEM "default")
else()
set(JLN_FLAGS_MSVC_ISYSTEM "${JLN_MSVC_ISYSTEM_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL "default")
else()
set(JLN_FLAGS_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL "${JLN_MSVC_ISYSTEM_WITH_TEMPLATE_FROM_NON_EXTERNAL_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_OPTIMIZATION)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_OPTIMIZATION "default")
else()
set(JLN_FLAGS_OPTIMIZATION "${JLN_OPTIMIZATION_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_PEDANTIC)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_PEDANTIC "on")
else()
set(JLN_FLAGS_PEDANTIC "${JLN_PEDANTIC_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_PIE)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_PIE "default")
else()
set(JLN_FLAGS_PIE "${JLN_PIE_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_RELRO)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_RELRO "default")
else()
set(JLN_FLAGS_RELRO "${JLN_RELRO_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_REPRODUCIBLE_BUILD_WARNINGS)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_REPRODUCIBLE_BUILD_WARNINGS "default")
else()
set(JLN_FLAGS_REPRODUCIBLE_BUILD_WARNINGS "${JLN_REPRODUCIBLE_BUILD_WARNINGS_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_RTTI)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_RTTI "default")
else()
set(JLN_FLAGS_RTTI "${JLN_RTTI_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_SANITIZERS)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_SANITIZERS "default")
else()
set(JLN_FLAGS_SANITIZERS "${JLN_SANITIZERS_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_SANITIZERS_EXTRA)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_SANITIZERS_EXTRA "default")
else()
set(JLN_FLAGS_SANITIZERS_EXTRA "${JLN_SANITIZERS_EXTRA_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_SHADOW_WARNINGS)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_SHADOW_WARNINGS "off")
else()
set(JLN_FLAGS_SHADOW_WARNINGS "${JLN_SHADOW_WARNINGS_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_STACK_PROTECTOR)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_STACK_PROTECTOR "default")
else()
set(JLN_FLAGS_STACK_PROTECTOR "${JLN_STACK_PROTECTOR_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_STL_DEBUG)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_STL_DEBUG "default")
else()
set(JLN_FLAGS_STL_DEBUG "${JLN_STL_DEBUG_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_STL_FIX)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_STL_FIX "on")
else()
set(JLN_FLAGS_STL_FIX "${JLN_STL_FIX_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_SUGGESTIONS)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_SUGGESTIONS "default")
else()
set(JLN_FLAGS_SUGGESTIONS "${JLN_SUGGESTIONS_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_WARNINGS)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_WARNINGS "on")
else()
set(JLN_FLAGS_WARNINGS "${JLN_WARNINGS_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_WARNINGS_AS_ERROR)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_WARNINGS_AS_ERROR "default")
else()
set(JLN_FLAGS_WARNINGS_AS_ERROR "${JLN_WARNINGS_AS_ERROR_D}")
endif()
endif()
if(NOT DEFINED JLN_FLAGS_WHOLE_PROGRAM)
if(JLN_FLAGS_DISABLE_OTHERS)
set(JLN_FLAGS_WHOLE_PROGRAM "default")
else()
set(JLN_FLAGS_WHOLE_PROGRAM "${JLN_WHOLE_PROGRAM_D}")
endif()
endif()
if ( ( JLN_GCC_CXX_COMPILER OR JLN_CLANG_CXX_COMPILER OR JLN_CLANG_CL_CXX_COMPILER ) )
if ( NOT ( JLN_FLAGS_WARNINGS STREQUAL "default") )
if ( JLN_FLAGS_WARNINGS STREQUAL "off" )
list(APPEND CXX_FLAGS "-w")
else()
if ( JLN_GCC_CXX_COMPILER )
list(APPEND CXX_FLAGS "-Wall" "-Wextra" "-Wcast-align" "-Wcast-qual" "-Wdisabled-optimization" "-Wfloat-equal" "-Wformat-security" "-Wformat=2" "-Wmissing-include-dirs" "-Wpacked" "-Wredundant-decls" "-Wundef" "-Wunused-macros" "-Winvalid-pch" "-Wpointer-arith" "-Wmissing-declarations" "-Wnon-virtual-dtor" "-Wold-style-cast" "-Woverloaded-virtual")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7" ) )
list(APPEND CXX_FLAGS "-Wsuggest-attribute=noreturn" "-Wzero-as-null-pointer-constant" "-Wlogical-op" "-Wvector-operation-performance" "-Wdouble-promotion" "-Wtrampolines")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" ) )
list(APPEND CXX_FLAGS "-Wuseless-cast")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9" ) )
list(APPEND CXX_FLAGS "-Wconditionally-supported" "-Wfloat-conversion")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1" ) )
list(APPEND CXX_FLAGS "-Wformat-signedness" "-Warray-bounds=2" "-Wstrict-null-sentinel" "-Wsuggest-override")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1" ) )
list(APPEND CXX_FLAGS "-Wduplicated-cond" "-Wnull-dereference")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0" ) )
list(APPEND CXX_FLAGS "-Waligned-new")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.1" ) )
list(APPEND CXX_FLAGS "-Walloc-zero" "-Walloca" "-Wformat-overflow=2" "-Wduplicated-branches")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0" ) )
list(APPEND CXX_FLAGS "-Wclass-memaccess")
endif()
endif()
endif()
endif()
endif()
endif()
endif()
endif()
else()
if ( ( JLN_CLANG_CXX_COMPILER OR JLN_CLANG_CL_CXX_COMPILER ) )
list(APPEND CXX_FLAGS "-Weverything" "-Wno-documentation" "-Wno-documentation-unknown-command" "-Wno-newline-eof" "-Wno-c++98-compat" "-Wno-c++98-compat-pedantic" "-Wno-mismatched-tags" "-Wno-padded" "-Wno-global-constructors" "-Wno-weak-vtables" "-Wno-exit-time-destructors" "-Wno-covered-switch-default" "-Wno-switch-default" "-Wno-switch-enum")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.9" ) )
list(APPEND CXX_FLAGS "-Wno-undefined-var-template")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0" ) )
list(APPEND CXX_FLAGS "-Wno-inconsistent-missing-destructor-override")
if ( NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0" ) )
list(APPEND CXX_FLAGS "-Wno-ctad-maybe-unsupported")
endif()
endif()
endif()
endif()
endif()
if ( ( JLN_FLAGS_WARNINGS STREQUAL "strict" OR JLN_FLAGS_WARNINGS STREQUAL "very_strict" ) )
list(APPEND CXX_FLAGS "-Wconversion")
if ( ( JLN_GCC_CXX_COMPILER AND NOT ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0" ) ) )
list(APPEND CXX_FLAGS "-Wcast-align=strict")
endif()
else()