mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-12-02 03:16:41 -08:00
Clang: use the same optimisation/stripping as gcc (#940)
Some gcc flags were only applied to gcc, but a lot of em really belong on clang too. It's the reason xp builds were 11 meg compared to gcc's 4. This brings them down to ~6 (mainly due to stripping). Clang complained that `-s` was a link-only flag so that's been changed too.
This commit is contained in:
1 file changed
+8
-6
@@ -141,6 +141,12 @@ else()
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") # for our logging system
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") # for our logging system
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") # fmtlib workaround
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") # fmtlib workaround
|
||||||
|
|
||||||
|
# static linking
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libgcc -static-libstdc++")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT MSVC)
|
||||||
# release flags
|
# release flags
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||||
|
|
||||||
@@ -160,8 +166,8 @@ else()
|
|||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fvisibility=hidden -fvisibility-inlines-hidden")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fvisibility=hidden -fvisibility-inlines-hidden")
|
||||||
|
|
||||||
# remove symbol table and relocation information
|
# remove symbol table and relocation information
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -s")
|
||||||
|
|
||||||
# performance
|
# performance
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -pipe")
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -pipe")
|
||||||
@@ -223,10 +229,6 @@ else()
|
|||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Og -pipe")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Og -pipe")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -pipe")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -pipe")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# static linking
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libgcc -static-libstdc++")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# default defines
|
# default defines
|
||||||
|
|||||||
Reference in new issue
Block a user