diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-04-24 16:49:12 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-04-24 16:57:58 +0200 |
commit | c2a669a9f03e249fb4fca96a2adf63256eb8dfa2 (patch) | |
tree | 711bd1f6ed3b110ba56af20d6995fe615c3ccf0d /modules | |
parent | e1d16e722ec9742c3f92d20dc433d540339c36e6 (diff) |
SCons: Review uses of CCFLAGS, CXXFLAGS and CPPFLAGS
Many contributors (me included) did not fully understand what CCFLAGS,
CXXFLAGS and CPPFLAGS refer to exactly, and were thus not using them
in the way they are intended to be.
As per the SCons manual: https://www.scons.org/doc/HTML/scons-user/apa.html
- CCFLAGS: General options that are passed to the C and C++ compilers.
- CFLAGS: General options that are passed to the C compiler (C only;
not C++).
- CXXFLAGS: General options that are passed to the C++ compiler. By
default, this includes the value of $CCFLAGS, so that setting
$CCFLAGS affects both C and C++ compilation.
- CPPFLAGS: User-specified C preprocessor options. These will be
included in any command that uses the C preprocessor, including not
just compilation of C and C++ source files [...], but also [...]
Fortran [...] and [...] assembly language source file[s].
TL;DR: Compiler options go to CCFLAGS, unless they must be restricted
to either C (CFLAGS) or C++ (CXXFLAGS). Preprocessor defines go to
CPPFLAGS.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bullet/SCsub | 2 | ||||
-rw-r--r-- | modules/etc/SCsub | 2 | ||||
-rw-r--r-- | modules/freetype/SCsub | 6 | ||||
-rw-r--r-- | modules/opus/SCsub | 12 | ||||
-rw-r--r-- | modules/svg/SCsub | 2 | ||||
-rw-r--r-- | modules/theora/SCsub | 2 | ||||
-rw-r--r-- | modules/vhacd/SCsub | 2 | ||||
-rw-r--r-- | modules/webm/SCsub | 2 | ||||
-rw-r--r-- | modules/webm/libvpx/SCsub | 4 | ||||
-rw-r--r-- | modules/websocket/SCsub | 2 | ||||
-rw-r--r-- | modules/xatlas_unwrap/SCsub | 12 |
11 files changed, 24 insertions, 24 deletions
diff --git a/modules/bullet/SCsub b/modules/bullet/SCsub index 7e714ba43f..e7c2fff54c 100644 --- a/modules/bullet/SCsub +++ b/modules/bullet/SCsub @@ -188,7 +188,7 @@ if env['builtin_bullet']: env_bullet.Append(CPPPATH=[thirdparty_dir]) # if env['target'] == "debug" or env['target'] == "release_debug": - # env_bullet.Append(CCFLAGS=['-DBT_DEBUG']) + # env_bullet.Append(CPPFLAGS=['-DBT_DEBUG']) env_thirdparty = env_bullet.Clone() env_thirdparty.disable_warnings() diff --git a/modules/etc/SCsub b/modules/etc/SCsub index 6e963ef766..eb2738053b 100644 --- a/modules/etc/SCsub +++ b/modules/etc/SCsub @@ -31,7 +31,7 @@ env_etc.Append(CPPPATH=[thirdparty_dir]) # upstream uses c++11 if not env.msvc: - env_etc.Append(CCFLAGS="-std=c++11") + env_etc.Append(CXXFLAGS="-std=c++11") env_thirdparty = env_etc.Clone() env_thirdparty.disable_warnings() diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index c2d165f367..f2cd9f9a60 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -72,9 +72,9 @@ if env['builtin_freetype']: # Also needed in main env for scene/ env.Append(CPPPATH=[thirdparty_dir + "/include"]) - env_freetype.Append(CCFLAGS=['-DFT2_BUILD_LIBRARY', '-DFT_CONFIG_OPTION_USE_PNG']) + env_freetype.Append(CPPFLAGS=['-DFT2_BUILD_LIBRARY', '-DFT_CONFIG_OPTION_USE_PNG']) if (env['target'] != 'release'): - env_freetype.Append(CCFLAGS=['-DZLIB_DEBUG']) + env_freetype.Append(CPPFLAGS=['-DZLIB_DEBUG']) # Also requires libpng headers if env['builtin_libpng']: @@ -100,4 +100,4 @@ if env['builtin_freetype']: # Godot source files env_freetype.add_source_files(env.modules_sources, "*.cpp") # Used in scene/, needs to be in main env -env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) +env.Append(CPPFLAGS=['-DFREETYPE_ENABLED']) diff --git a/modules/opus/SCsub b/modules/opus/SCsub index b72144c679..a1325734e2 100644 --- a/modules/opus/SCsub +++ b/modules/opus/SCsub @@ -139,7 +139,7 @@ if env['builtin_opus']: opus_sources_silk = [] if env["platform"] in ["android", "iphone", "javascript"]: - env_opus.Append(CFLAGS=["-DFIXED_POINT"]) + env_opus.Append(CPPFLAGS=["-DFIXED_POINT"]) opus_sources_silk = [ "silk/fixed/LTP_analysis_filter_FIX.c", "silk/fixed/LTP_scale_ctrl_FIX.c", @@ -208,7 +208,7 @@ if env['builtin_opus']: if env['builtin_libogg']: env_opus.Append(CPPPATH=["#thirdparty/libogg"]) - env_opus.Append(CFLAGS=["-DHAVE_CONFIG_H"]) + env_opus.Append(CPPFLAGS=["-DHAVE_CONFIG_H"]) thirdparty_include_paths = [ "", @@ -222,14 +222,14 @@ if env['builtin_opus']: if env["platform"] == "android": if ("android_arch" in env and env["android_arch"] in ["armv6", "armv7"]): - env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"]) + env_opus.Append(CPPFLAGS=["-DOPUS_ARM_OPT"]) elif ("android_arch" in env and env["android_arch"] == "arm64v8"): - env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"]) + env_opus.Append(CPPFLAGS=["-DOPUS_ARM64_OPT"]) elif env["platform"] == "iphone": if ("arch" in env and env["arch"] == "arm"): - env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"]) + env_opus.Append(CPPFLAGS=["-DOPUS_ARM_OPT"]) elif ("arch" in env and env["arch"] == "arm64"): - env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"]) + env_opus.Append(CPPFLAGS=["-DOPUS_ARM64_OPT"]) env_thirdparty = env_opus.Clone() env_thirdparty.disable_warnings() diff --git a/modules/svg/SCsub b/modules/svg/SCsub index 22f0b1e3eb..66d9b3bf75 100644 --- a/modules/svg/SCsub +++ b/modules/svg/SCsub @@ -16,7 +16,7 @@ env_svg.Append(CPPPATH=[thirdparty_dir]) # FIXME: Needed in editor/editor_themes.cpp for now, but ideally there # shouldn't be a dependency on modules/ and its own 3rd party deps. env.Append(CPPPATH=[thirdparty_dir]) -env.Append(CCFLAGS=["-DSVG_ENABLED"]) +env.Append(CPPFLAGS=["-DSVG_ENABLED"]) env_thirdparty = env_svg.Clone() env_thirdparty.disable_warnings() diff --git a/modules/theora/SCsub b/modules/theora/SCsub index 98c4274a7e..f98db2359c 100644 --- a/modules/theora/SCsub +++ b/modules/theora/SCsub @@ -66,7 +66,7 @@ if env['builtin_libtheora']: thirdparty_sources += thirdparty_sources_x86_vc if (env["x86_libtheora_opt_gcc"] or env["x86_libtheora_opt_vc"]): - env_theora.Append(CCFLAGS=["-DOC_X86_ASM"]) + env_theora.Append(CPPFLAGS=["-DOC_X86_ASM"]) thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] diff --git a/modules/vhacd/SCsub b/modules/vhacd/SCsub index 11cd5f4743..fdd3ddc1e6 100644 --- a/modules/vhacd/SCsub +++ b/modules/vhacd/SCsub @@ -29,7 +29,7 @@ env_vhacd.Append(CPPFLAGS=["-DGODOT_ENET"]) # upstream uses c++11 if not env.msvc: - env_vhacd.Append(CCFLAGS="-std=c++11") + env_vhacd.Append(CXXFLAGS="-std=c++11") env_thirdparty = env_vhacd.Clone() env_thirdparty.disable_warnings() diff --git a/modules/webm/SCsub b/modules/webm/SCsub index cb35b926ab..dcc9a45044 100644 --- a/modules/webm/SCsub +++ b/modules/webm/SCsub @@ -19,7 +19,7 @@ env_webm.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"]) # upstream uses c++11 if (not env_webm.msvc): - env_webm.Append(CCFLAGS="-std=c++11") + env_webm.Append(CXXFLAGS="-std=c++11") # also requires libogg, libvorbis and libopus if env['builtin_libogg']: diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index 2639d20620..5bf4ea3464 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -323,7 +323,7 @@ if webm_cpu_x86: elif cpu_bits == '64': env_libvpx["ASCPU"] = 'X86_64' - env_libvpx.Append(CCFLAGS=['-DWEBM_X86ASM']) + env_libvpx.Append(CPPFLAGS=['-DWEBM_X86ASM']) webm_simd_optimizations = True @@ -337,7 +337,7 @@ if webm_cpu_arm: env_libvpx["ASFLAGS"] = '' env_libvpx["ASCOM"] = '$AS $ASFLAGS -o $TARGET $SOURCES' - env_libvpx.Append(CCFLAGS=['-DWEBM_ARMASM']) + env_libvpx.Append(CPPFLAGS=['-DWEBM_ARMASM']) webm_simd_optimizations = True diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub index 0345e533bc..12b4969cf7 100644 --- a/modules/websocket/SCsub +++ b/modules/websocket/SCsub @@ -88,7 +88,7 @@ if env['builtin_libwebsockets'] and not env["platform"] == "javascript": # alrea env_lws.Append(CPPPATH=[helper_dir]) if env["platform"] == "uwp": - env_lws.Append(CCFLAGS=["/DLWS_MINGW_SUPPORT"]) + env_lws.Append(CPPFLAGS=["/DLWS_MINGW_SUPPORT"]) env_thirdparty = env_lws.Clone() env_thirdparty.disable_warnings() diff --git a/modules/xatlas_unwrap/SCsub b/modules/xatlas_unwrap/SCsub index ad364d5aaf..b8adfcb7df 100644 --- a/modules/xatlas_unwrap/SCsub +++ b/modules/xatlas_unwrap/SCsub @@ -24,18 +24,18 @@ if env['builtin_xatlas']: if env["platform"] == 'x11': # if not specifically one of the *BSD, then use LINUX as default if platform.system() == "FreeBSD": - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"]) + env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"]) elif platform.system() == "OpenBSD": - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"]) + env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"]) else: - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"]) + env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"]) elif env["platform"] == 'osx': - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"]) + env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"]) elif env["platform"] == 'windows': if env.msvc: - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ]) + env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ]) else: - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"]) + env_xatlas_unwrap.Append(CPPFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"]) env.Append(LIBS=["dbghelp"]) env_thirdparty = env_xatlas_unwrap.Clone() |