//BuildCmpCmdLine.h

// Copyright Querysoft Limited 2017
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
// 
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

//Definitions needed to construct an MSVC 2017 command line

#define QOR_PP_BUILD_CMP_OPT_SWTICH_PRE					/

#ifndef NDEBUG
#	ifndef QOR_PP_CONFIG_INT_DIR
#		define QOR_PP_CONFIG_INT_DIR						Debug/
#	endif
#	define QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_OPTS		( 2, ( MTd, MDd ) )
#else
#	define QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_OPTS		( 2, ( MT, MD ) )
#	ifndef QOR_PP_CONFIG_INT_DIR
#		define QOR_PP_CONFIG_INT_DIR						Release/
#	endif
#endif

//general
//	includes
#define QOR_PP_BUILD_CMP_INCLUDE_PATH_OPT				I//Switch for include folders
#define QOR_PP_BUILD_CMP_DEFINE_OPT						D//SWitch for preprocessor definitions

//	Debug format
#define QOR_PP_BUILD_CMP_DEBUG_FORMAT_OPTS				( 3,( Z7 /*C7 compatible*/, Zi /*Program Databse*/, ZI /*Edit and Continue*/ ) )
#define QOR_PP_BUILD_CMP_DEBUG_FORMAT_SELECT_DEFAULT	1
#ifndef QOR_PP_BUILD_CMP_DEBUG_FORMAT_SELECT
#	define QOR_PP_BUILD_CMP_DEBUG_FORMAT_SELECT			QOR_PP_BUILD_CMP_DEBUG_FORMAT_SELECT_DEFAULT
#endif
#define QOR_PP_BUILD_CMP_DEBUG_FORMAT_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_DEBUG_FORMAT_SELECT, QOR_PP_BUILD_CMP_DEBUG_FORMAT_OPTS )			

//	Logo supression
#define QOR_PP_BUILD_CMP_SUPRESS_LOGO_OPTS				( 2, ( QOR_PP_EMPTY(), nologo ) )
#define QOR_PP_BUILD_CMP_SUPRESS_LOGO_SELECT_DEFAULT	1
#ifndef QOR_PP_BUILD_CMP_SUPRESS_LOGO_SELECT
#	define QOR_PP_BUILD_CMP_SUPRESS_LOGO_SELECT			QOR_PP_BUILD_CMP_SUPRESS_LOGO_SELECT_DEFAULT
#endif
#define QOR_PP_BUILD_CMP_SUPRESS_LOGO_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_SUPRESS_LOGO_SELECT, QOR_PP_BUILD_CMP_SUPRESS_LOGO_OPTS )

//	Warning level
#define QOR_PP_BUILD_CMP_WARNING_LEVEL_OPTS				( 6,( W0, W1, W2, W3, W4, Wall ) )
#define QOR_PP_BUILD_CMP_WARNING_LEVEL_SELECT_DEFAULT	4
#ifndef QOR_PP_BUILD_CMP_WARNING_LEVEL_SELECT
#	define QOR_PP_BUILD_CMP_WARNING_LEVEL_SELECT		QOR_PP_BUILD_CMP_WARNING_LEVEL_SELECT_DEFAULT
#endif
#define QOR_PP_BUILD_CMP_WARNING_LEVEL_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_WARNING_LEVEL_SELECT, QOR_PP_BUILD_CMP_WARNING_LEVEL_OPTS )

//	Warnings as errors
#define QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_OPTS		( 2,( WX-, WX ) )
#define QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_SELECT_DEF	0
#ifndef	QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_SELECT
#	define QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_SELECT	QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_SELECT_DEF	
#endif
#define QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_OPT			QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_SELECT, QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_OPTS )

//	Multiprocessor build
#define QOR_PP_BUILD_CMP_MULTIPROCESSOR_OPTS			( 2, ( QOR_PP_EMPTY(), MP ) )
#define QOR_PP_BUILD_CMP_MULTIPROCESSOR_SELECT_DEFAULT	1
#ifndef QOR_PP_BUILD_CMP_MULTIPROCESSOR_SELECT
#	define QOR_PP_BUILD_CMP_MULTIPROCESSOR_SELECT		QOR_PP_BUILD_CMP_MULTIPROCESSOR_SELECT_DEFAULT
#endif
#define QOR_PP_BUILD_CMP_MULTIPROCESSOR_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_MULTIPROCESSOR_SELECT, QOR_PP_BUILD_CMP_MULTIPROCESSOR_OPTS )


#define QOR_PP_BUILD_CMP_SWITCHES_GENERAL				QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_DEBUG_FORMAT_OPT )	\
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_SUPRESS_LOGO_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_WARNING_LEVEL_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_WARNINGS_AS_ERRORS_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_MULTIPROCESSOR_OPT )

//Optimization
#define QOR_PP_BUILD_CMP_OPTIMIZATION_OPTS				( 4, ( Od, O1, O2, Ox ) )
#define QOR_PP_BUILD_CMP_OPTIMIZATION_SELECT_DEFAULT	0
#ifndef QOR_PP_BUILD_CMP_OPTIMIZATION_SELECT
#	define QOR_PP_BUILD_CMP_OPTIMIZATION_SELECT			QOR_PP_BUILD_CMP_OPTIMIZATION_SELECT_DEFAULT
#endif
#define QOR_PP_BUILD_CMP_OPTIMIZATION_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_OPTIMIZATION_SELECT, QOR_PP_BUILD_CMP_OPTIMIZATION_OPTS )

//	inlines
#define QOR_PP_BUILD_CMP_INLINE_EXPANSION_OPTS			( 4, ( QOR_PP_EMPTY(), Ob0, Ob1, Ob2 ) )
#define QOR_PP_BUILD_CMP_INLINE_EXPANSION_SELECT_DEF	3
#ifndef QOR_PP_BUILD_CMP_INLINE_EXPANSION_SELECT
#	define QOR_PP_BUILD_CMP_INLINE_EXPANSION_SELECT		QOR_PP_BUILD_CMP_INLINE_EXPANSION_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_INLINE_EXPANSION_OPT			QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_INLINE_EXPANSION_SELECT, QOR_PP_BUILD_CMP_INLINE_EXPANSION_OPTS )

//	intrinsics
#define QOR_PP_BUILD_CMP_INTRINSICS_OPTS				( 2, ( QOR_PP_EMPTY(), Oi ) )
#define QOR_PP_BUILD_CMP_INTRINSICS_SELECT_DEF			QOR_PP_IF( QOR_PP_EQUAL( QOR_PP_BUILD_CMP_INTRINSICS_ENABLE, __QCS_YES_ ), 1, 0 )
#ifndef QOR_PP_BUILD_CMP_INTRINSICS_SELECT
#	define QOR_PP_BUILD_CMP_INTRINSICS_SELECT			QOR_PP_BUILD_CMP_INTRINSICS_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_INTRINSICS_OPT					QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_INTRINSICS_SELECT, QOR_PP_BUILD_CMP_INTRINSICS_OPTS )

//	frame pointer
#define QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_OPTS		( 2, ( Oy-, Oy ) )
#define QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_SELECT_DEF	0
#ifndef QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_SELECT
#	define QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_SELECT	QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_OPT		QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_SELECT, QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_OPTS )

#define QOR_PP_BUILD_CMP_SWITCHES_OPTIMIZATION			QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_OPTIMIZATION_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_INLINE_EXPANSION_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_INTRINSICS_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_OMIT_FRAME_POINTERS_OPT )


//Preprocessor

//	options
#define	QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_OPTS		( 2, ( QOR_PP_EMPTY(), X ) )
#define QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_SELECT_DEF	1
#ifndef QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_SELECT
#	define QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_SELECT	QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_SELECT_DEF
#endif
#define	QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_OPT		QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_SELECT, QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_OPTS )

#define QOR_PP_BUILD_CMP_SWITCHES_PREPROCESSOR			QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_IGNORE_STANDARD_INC_OPT )


//Code generation

//	minimal rebuild
#define QOR_PP_BUILD_CMP_MINIMAL_REBUILD_OPTS			( 2, ( Gm-, Gm ) )
#define QOR_PP_BUILD_CMP_MINIMAL_REBUILD_SELECT_DEF		0
#ifndef QOR_PP_BUILD_CMP_MINIMAL_REBUILD_SELECT
#	define QOR_PP_BUILD_CMP_MINIMAL_REBUILD_SELECT		QOR_PP_BUILD_CMP_MINIMAL_REBUILD_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_MINIMAL_REBUILD_OPT			QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_MINIMAL_REBUILD_SELECT, QOR_PP_BUILD_CMP_MINIMAL_REBUILD_OPTS )

//	exceptions
#define QOR_PP_BUILD_CMP_CPP_EXCPETIONS_OPTS			( 4, ( QOR_PP_EMPTY(), EHa, EHsc, EHs ) )
#define QOR_PP_BUILD_CMP_CPP_EXCEPTIONS_SELECT_DEF		QOR_PP_IF( QOR_PP_EQUAL( QOR_PP_EXPAND(__QOR_CPP_EXCEPTIONS), 1), 2, 0 )
#ifndef QOR_PP_BUILD_CMP_CPP_EXCEPTIONS_SELECT
#	define QOR_PP_BUILD_CMP_CPP_EXCEPTIONS_SELECT		QOR_PP_BUILD_CMP_CPP_EXCEPTIONS_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_CPP_EXCEPTIONS_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_CPP_EXCEPTIONS_SELECT, QOR_PP_BUILD_CMP_CPP_EXCPETIONS_OPTS )

//	Runtime Checks
#define QOR_PP_BUILD_CMP_RUNTIME_CHECKS_OPTS			( 4, ( RTCs, RTCu, RTCsu, RTC1 ) )
#define QOR_PP_BUILD_CMP_RUNTIME_CHECKS_SELECT_DEF		2
#ifndef QOR_PP_BUILD_CMP_RUNTIME_CHECKS_SELECT
#	define QOR_PP_BUILD_CMP_RUNTIME_CHECKS_SELECT		QOR_PP_BUILD_CMP_RUNTIME_CHECKS_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_RUNTIME_CHECKS_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_RUNTIME_CHECKS_SELECT, QOR_PP_BUILD_CMP_RUNTIME_CHECKS_OPTS )

//	runtime library
#define QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_SELECT_DEF		1
#ifndef QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_SELECT
#	define QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_SELECT		QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_OPT			QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_SELECT, QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_OPTS )

//	Security
#define QOR_PP_BUILD_CMP_BUFFER_SECURITY_OPTS			( 2, ( GS-, GS ) )				 //dependent on Config safety level and OS
#define QOR_PP_BUILD_CMP_BUFFER_SECURITY_SELECT_DEF		0
#ifndef QOR_PP_BUILD_CMP_BUFFER_SECURITY_SELECT
#	define QOR_PP_BUILD_CMP_BUFFER_SECURITY_SELECT		QOR_PP_BUILD_CMP_BUFFER_SECURITY_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_BUFFER_SECURITY				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_BUFFER_SECURITY_SELECT, QOR_PP_BUILD_CMP_BUFFER_SECURITY_OPTS )

//	Floating point model
#define QOR_PP_BUILD_CMP_FLOATING_POINT_MODEL_OPTS		( 3, ( fp:precise, fp:strict, fp:fast ) )
#define QOR_PP_BUILD_CMP_FLOATING_POINT_SELECT_DEF 1
#ifndef QOR_PP_BUILD_CMP_FLOATING_POINT_SELECT
#	define QOR_PP_BUILD_CMP_FLOATING_POINT_SELECT		QOR_PP_BUILD_CMP_FLOATING_POINT_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_FLOATING_POINT_MODEL_OPT		QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_FLOATING_POINT_SELECT, QOR_PP_BUILD_CMP_FLOATING_POINT_MODEL_OPTS )

#define QOR_PP_BUILD_CMP_SWITCHES_CODE_GENERATION		QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_MINIMAL_REBUILD_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_CPP_EXCEPTIONS_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_RUNTIME_CHECKS_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_RUNTIME_LIBRARY_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_BUFFER_SECURITY ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_FLOATING_POINT_MODEL_OPT )

//Language

//	wchar_t
#define QOR_PP_BUILD_CMP_WCHART_BUILTIN_OPTS			( 2, ( Zc:wchar_t, Zc:wchar_t- ) )
#define QOR_PP_BUILD_CMP_WCHART_BUILTIN_SELECT_DEF		0
#ifndef QOR_PP_BUILD_CMP_WCHART_BUILTIN_SELECT
#	define QOR_PP_BUILD_CMP_WCHART_BUILTIN_SELECT		QOR_PP_BUILD_CMP_WCHART_BUILTIN_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_WCHART_BUILTIN_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_WCHART_BUILTIN_SELECT, QOR_PP_BUILD_CMP_WCHART_BUILTIN_OPTS )

//	for scope
#define QOR_PP_BUILD_CMP_FORSCOPE_OPTS					( 2, ( Zc:forScope, Zc:forScope- ) )
#define QOR_PP_BUILD_CMP_FORESCOPE_SELECT_DEF			0
#ifndef QOR_PP_BUILD_CMP_FORESCOPE_SELECT
#	define QOR_PP_BUILD_CMP_FORESCOPE_SELECT			QOR_PP_BUILD_CMP_FORESCOPE_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_FORSCOPE_OPT					QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_FORESCOPE_SELECT, QOR_PP_BUILD_CMP_FORSCOPE_OPTS )

//	Thread Safe Init
#define QOR_PP_BUILD_CMP_THREADSAFEINIT_OPTS			( 2, ( QOR_PP_EMPTY(), Zc:threadSafeInit- ) )
#define QOR_PP_BUILD_CMP_THREADSAFEINIT_SELECT_DEF		1
#ifndef QOR_PP_BUILD_CMP_THREADSAFEINIT_SELECT
#	define QOR_PP_BUILD_CMP_THREADSAFEINIT_SELECT		QOR_PP_BUILD_CMP_THREADSAFEINIT_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_THREADSAFEINIT_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_THREADSAFEINIT_SELECT, QOR_PP_BUILD_CMP_THREADSAFEINIT_OPTS )

//	Sized Dealloc
#define QOR_PP_BUILD_CMP_SIZEDDEALLOC_OPTS				( 2, ( QOR_PP_EMPTY(), Zc:sizedDealloc- ) )
#define QOR_PP_BUILD_CMP_SIZEDDEALLOC_SELECT_DEF		1
#ifndef QOR_PP_BUILD_CMP_SIZEDDEALLOC_SELECT
#	define QOR_PP_BUILD_CMP_SIZEDDEALLOC_SELECT			QOR_PP_BUILD_CMP_SIZEDDEALLOC_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_SIZEDDEALLOC_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_SIZEDDEALLOC_SELECT, QOR_PP_BUILD_CMP_SIZEDDEALLOC_OPTS )

//	Implicit NoExcept
#define QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_OPTS				( 2, ( QOR_PP_EMPTY(), Zc:implicitNoexcept- ) )
#define QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_SELECT_DEF		1
#ifndef QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_SELECT
#	define QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_SELECT			QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_SELECT, QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_OPTS )


//	RTTI
#define QOR_PP_BUILD_CMP_ENABLE_RTTI_OPTS				( 2, ( GR, GR- ) )
#define QOR_PP_BUILD_CMP_ENABLE_RTTI_SELECT_DEF			0
#ifndef QOR_PP_BUILD_CMP_ENABLE_RTTI_SELECT
#	define QOR_PP_BUILD_CMP_ENABLE_RTTI_SELECT			QOR_PP_BUILD_CMP_ENABLE_RTTI_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_ENABLE_RTTI_OPT				QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_ENABLE_RTTI_SELECT, QOR_PP_BUILD_CMP_ENABLE_RTTI_OPTS )

#define QOR_PP_BUILD_CMP_SWITCHES_LANGUAGE				QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_WCHART_BUILTIN_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_FORSCOPE_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_THREADSAFEINIT_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_SIZEDDEALLOC_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_IMPLICITNOEXCEPT_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_ENABLE_RTTI_OPT )

//Precompiled header
#define QOR_PP_BUILD_CMP_PRECOMPILED_HEADER_OPT			Fp

//Output files
#define QOR_PP_BUILD_CMP_ASM_LIST_LOCATION_OPT			Fa
#define QOR_PP_BUILD_CMP_OBJECT_FILE_LOCATION_OPT		Fo
#define QOR_PP_BUILD_CMP_PROGRAM_DATABASE_FILE_OPT		Fd

#define QOR_PP_BUILD_CMP_OUT_ASM_CMD					QOR_PP_CAT( QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_ASM_LIST_LOCATION_OPT ), QOR_PP_EXPAND( QOR_PP_STRINGIZE( QOR_PP_CONFIG_OBJ_DIR ) ) )
#define QOR_PP_BUILD_CMP_OUT_OBJ_CMD					QOR_PP_CAT( QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_OBJECT_FILE_LOCATION_OPT ), QOR_PP_EXPAND( QOR_PP_STRINGIZE( QOR_PP_CONFIG_OBJ_DIR ) ) )
#define QOR_PP_BUILD_CMD_OUT_PDB_CMD					QOR_PP_CAT( QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_PROGRAM_DATABASE_FILE_OPT ), QOR_PP_EXPAND( QOR_PP_STRINGIZE( QOR_PP_CAT( QOR_PP_CONFIG_OBJ_DIR, vc140.pdb ) ) ) )

#define QOR_PP_BUILD_CMP_OUT_ASM_OPTIONS				( 2, ( QOR_PP_EMPTY(), QOR_PP_BUILD_CMP_OUT_ASM_CMD ) )
#define QOR_PP_BUILD_CMP_OUT_ASM_SELECT_DEF				0
#ifndef QOR_PP_BUILD_CMP_OUT_ASM_SELECT
#	define QOR_PP_BUILD_CMP_OUT_ASM_SELECT				QOR_PP_BUILD_CMP_OUT_ASM_SELECT_DEF
#endif

#define QOR_PP_BUILD_CMP_OUT_ASM_OPT					QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_OUT_ASM_SELECT, QOR_PP_BUILD_CMP_OUT_ASM_OPTIONS )

#define QOR_PP_BUILD_CMP_SWITCHES_OUTPUT				QOR_PP_BUILD_CMP_OUT_ASM_OPT \
														QOR_PP_CAT( QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_OBJECT_FILE_LOCATION_OPT ), QOR_PP_EXPAND( QOR_PP_STRINGIZE( QOR_PP_CONFIG_OBJ_DIR ) ) ) \
														QOR_PP_CAT( QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_PROGRAM_DATABASE_FILE_OPT ), QOR_PP_EXPAND( QOR_PP_STRINGIZE( QOR_PP_CAT( QOR_PP_CONFIG_OBJ_DIR, vc140.pdb ) ) ) )
//Advanced

//Compile As
#define QOR_PP_BUILD_CMP_COMPILE_AS_CPP					0
#define QOR_PP_BUILD_CMP_COMPILE_AS_C					1
#define QOR_PP_BUILD_CMP_COMPILE_AS_OPTS				( 3, (TP,TC,QOR_PP_EMPTY()))
#define QOR_PP_BUILD_CMP_COMPILE_AS_OPTS_SELECT_DEF		2
#ifndef QOR_PP_BUILD_CMP_COMPILE_AS_SELECT
#	define QOR_PP_BUILD_CMP_COMPILE_AS_SELECT			QOR_PP_BUILD_CMP_COMPILE_AS_OPTS_SELECT_DEF
#endif
#define QOR_PP_BUILD_CMP_COMPILE_AS_OPT					QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_COMPILE_AS_SELECT, QOR_PP_BUILD_CMP_COMPILE_AS_OPTS )

#ifdef QOR_PP_BUILD_CMP_ASSEMBLE
#	define QOR_SOURCE_EXT .asm
#else
#	if ( QOR_PP_BUILD_CMP_COMPILE_AS_SELECT == QOR_PP_BUILD_CMP_COMPILE_AS_C )
#		define QOR_SOURCE_EXT .c
#	else
#		define QOR_SOURCE_EXT .cpp
#	endif
#endif

#define QOR_OBJECT_EXT .obj

//	calling conventions
#define QOR_PP_BUILD_CMP_CALLING_CONVENTION_OPTS		( 3, ( Gd, Gr, Gz ) )
#define QOR_PP_BUILD_CMP_CALLING_CONVENTION_SELECT		0
#define QOR_PP_BUILD_CMP_CALLING_CONVENTION_OPT			QOR_PP_ARRAY_ELEM( QOR_PP_BUILD_CMP_CALLING_CONVENTION_SELECT, QOR_PP_BUILD_CMP_CALLING_CONVENTION_OPTS )
#define QOR_PP_BUILD_CMP_ANALYSE_OPT					QOR_PP_EMPTY()
#define QOR_PP_BUILD_CMP_INTERNAL_ERROR_REPORTING_OPT	errorReport:queue

#define QOR_PP_BUILD_CMP_SWITCHES_ADVANCED				QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_COMPILE_AS_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_CALLING_CONVENTION_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_ANALYSE_OPT ) \
														QOR_PP_BUILD_CMP_MAKE_OPT( QOR_PP_BUILD_CMP_INTERNAL_ERROR_REPORTING_OPT )

#ifdef __QOR_UNICODE
#	define QOR_PP_BUILD_UNICODE_OPTIONS /D"UNICODE" /D"_UNICODE"
#	else
#	define QOR_PP_BUILD_UNICODE_OPTIONS
#endif

#define QOR_PP_BUILD_CMP_MAKE_OPT( _X )					QOR_PP_IF( QOR_PP_IS_EMPTY( QOR_PP_EXPAND( _X ) ), QOR_PP_EMPTY(), QOR_PP_CAT(QOR_PP_BUILD_CMP_OPT_SWTICH_PRE, _X) )

#define QOR_PP_BUILD_CMP_INCLUDES						QOR_PP_SEQ_FOR_EACH_I( QOR_PP_BUILD_CMP_MAKE_INCLUDE, QOR_PP_BUILD_CMP_INCLUDE_PATH_OPT, QOR_CONFIG_INCLUDES )
#define QOR_PP_BUILD_CMP_MAKE_INCLUDE( r, _SWITCH, _IGNORE, _ITEM )	QOR_PP_BUILD_CMP_MAKE_OPT(_SWITCH) QOR_PP_STRINGIZE( _ITEM )

#ifndef NDEBUG
#	define QOR_CONFIG_DEFINES_COMPILER					QOR_PP_LIST_APPEND( QOR_CONFIG_DEFINES_MODULE, ("_DEBUG") )
#else
#	define QOR_CONFIG_DEFINES_COMPILER					QOR_CONFIG_DEFINES_MODULE
#endif

#define QOR_PP_BUILD_CMP_DEFINES						QOR_PP_LIST_FOR_EACH( QOR_PP_BUILD_CMP_MAKE_DEFINE, QOR_PP_BUILD_CMP_DEFINE_OPT, QOR_CONFIG_DEFINES_COMPILER )
#define QOR_PP_BUILD_CMP_MAKE_DEFINE( r, _SWITCH, _ITEM ) QOR_PP_CAT( QOR_PP_BUILD_CMP_MAKE_OPT(_SWITCH),_ITEM )

#define QOR_PP_BUILD_CMP_SWITCHES_ALL					QOR_PP_BUILD_CMP_SWITCHES_GENERAL \
														QOR_PP_BUILD_CMP_SWITCHES_OPTIMIZATION \
														QOR_PP_BUILD_CMP_SWITCHES_PREPROCESSOR \
														QOR_PP_BUILD_CMP_DEFINES \
														QOR_PP_BUILD_UNICODE_OPTIONS\
														%build_env_params%\
														QOR_PP_BUILD_CMP_SWITCHES_CODE_GENERATION \
														QOR_PP_BUILD_CMP_SWITCHES_LANGUAGE \
														QOR_PP_BUILD_CMP_SWITCHES_OUTPUT \
														QOR_PP_BUILD_CMP_SWITCHES_ADVANCED

#define QOR_PP_BUILD_CMP_OPTIONS						QOR_PP_BUILD_CMP_INCLUDES QOR_PP_BUILD_CMP_SWITCHES_ALL 

#define QOR_PP_BUILD_CMP_COMMAND_LINE(_PATH,_EXTENSION,_X) \
														QOR_PP_BUILD_COMPILER_EXECUTABLE QOR_PP_BUILD_CMP_MAKE_OPT( c ) QOR_PP_BUILD_CMP_OPTIONS QOR_PP_CAT(_PATH,QOR_PP_CAT(_X,_EXTENSION))

