Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions cmake/Modules/CocosConfigDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,6 @@ endfunction()
if(MSVC)
target_compile_options(${target}
PUBLIC /MP
PUBLIC /Z7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason to add /Z7 is too large PDB file occurs to me when compile cpp-tests project

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/Z7 it is old debug format.
All CI tests passed

Copy link
Contributor

@stevetranby stevetranby Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this has been discussed where compiling would fail without /Z7, but it may not necessary for VS2017+ due to the improvements in the debugging database system(s). I'm not sure the best course of action here though, but maybe if you can add that option only to cpp-tests then that would be good enough since others can choose to modify their own project target options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevetranby idea of this change is that common cmake configuration does not force settings on user. If user really want to change something it possible from his code without changing cocos code. It is bad cmake practice to set compiler flags https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1#get-your-hands-off-cmake_cxx_flags

About visual studio debug database (pdb files): from my experience it does not matter with or without /Z7 pdb become broken from time to time ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Makes sense to give control to user.

Maybe best to just document in cpp-tests that one can try no debug (??option??) or light debug (/Z7) if they have issues building.

I am not sure if the new templated CCActions helped or hurt in that regard, but I remember the "PDB too large" issue for me was related to the large amount of code and derived classes for all the actions.

(It would be great to see the action system refactored into a "few lines of code" generic approach by passing in easing function instead of having the large hierarchy of derived classes - even if now templated).

I digress :-]

PUBLIC /MD$<$<CONFIG:Debug>:d>
)
else()
target_compile_options(${target}
PUBLIC -Wall
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Wall is one of the the defaults values, too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In modern cmake flags should not be set inside library. Please see for example:
https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1#dont-abuse-usage-requirements

We may add this to root folder but it should not be set here (and definitely not as PUBLIC).

PUBLIC $<$<CONFIG:Debug>:-g>
)
if(LINUX)
target_compile_options(${target} PUBLIC -pthread)
endif()
endif()
if(ANDROID)
target_compile_options(${target} PUBLIC -fsigned-char)
endif()
endfunction()
2 changes: 1 addition & 1 deletion cocos/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cpufeatures

# define the macro to compile through support/zip_support/ioapi.c
LOCAL_CFLAGS := -DUSE_FILE32API
LOCAL_CFLAGS += -fexceptions
LOCAL_CFLAGS += -fexceptions -fsigned-char
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add -fsigned-char into Android.mk, it already been added into Application.mk

APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char -Wno-extern-c-compat

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank I will remove it


# Issues #9968
#ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
Expand Down
2 changes: 1 addition & 1 deletion cocos/editor-support/cocostudio/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. \
$(LOCAL_PATH)/WidgetReader

LOCAL_CFLAGS += -fexceptions
LOCAL_CFLAGS += -fexceptions -fsigned-char

LOCAL_STATIC_LIBRARIES := ccui
LOCAL_STATIC_LIBRARIES += ccds
Expand Down
2 changes: 1 addition & 1 deletion extensions/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ LOCAL_STATIC_LIBRARIES += ccnet
LOCAL_STATIC_LIBRARIES += ext_box2d
LOCAL_STATIC_LIBRARIES += ext_bullet

LOCAL_CXXFLAGS += -fexceptions
LOCAL_CXXFLAGS += -fexceptions -fsigned-char

LOCAL_C_INCLUDES := $(LOCAL_PATH)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
cmake {
targets 'MyGame'
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
else if (PROP_BUILD_TYPE == 'cmake') {
cmake {
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {
else if (PROP_BUILD_TYPE == 'cmake') {
cmake {
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-empty-test/proj.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
targets "cpp_empty_test"
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang",
"-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/proj.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
cmake {
targets 'cpp_tests'
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/js-tests/project/proj.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
cmake {
targets "js_tests"
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/lua-empty-test/project/proj.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
cmake {
targets "lua_empty_test"
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/lua-tests/project/proj.android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
cmake {
targets 'lua_tests'
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions"
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
}
Expand Down