Skip to content

Commit d010aff

Browse files
committed
new implementation
1 parent 9f44812 commit d010aff

File tree

10 files changed

+457
-314
lines changed

10 files changed

+457
-314
lines changed

CMakeLists.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,14 @@ endif()
7070
# FIXME: this reports an unused architecture if only vms are built.
7171
# We may not be able to avoid this for now without doing a huge rewrite
7272
# of this file.
73-
if (NOT (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMMY_APP))
74-
message(NOTICE "You can safely ignore the following reported architecture, it is not used.")
75-
endif()
76-
include(DaemonPlatform)
77-
7873
# FIXME: this reports an unused compiler if only vms are built.
7974
# We cannot avoid this for now without doing a huge rewrite of this files
8075
# since we also set useless flags using informations provided by this.
8176
if (NOT (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMMY_APP))
77+
message(NOTICE "You can safely ignore the following reported architecture, it is not used.")
8278
message(NOTICE "You can safely ignore the following reported compilers, they are unused.")
8379
endif()
84-
include(DaemonCompiler)
80+
include(DaemonPlatform)
8581

8682
if (Daemon_OUT)
8783
set(CMAKE_CURRENT_BINARY_DIR ${Daemon_OUT})
@@ -438,9 +434,11 @@ function(ADD_PRECOMPILED_HEADER Target)
438434
set(Header ${COMMON_DIR}/Common.h)
439435

440436
# Compiler-specific PCH support
441-
if (DAEMON_COMPILER_IS_GNUCXX OR DAEMON_COMPILER_IS_CLANGCXX OR NACL)
437+
if (DAEMON_CXX_COMPILER_GCC_COMPATIBILITY OR DAEMON_CXX_COMPILER_Clang_COMPATIBILITY)
438+
# There is a bug in CMake: if we set CMAKE_CXX_COMPILER to "zig;c++",
439+
# only "zig" is returned when using the ${CMAKE_CXX_COMPILER} variable.
442440
add_custom_command(OUTPUT "${OBJ_DIR}/${Target}.h.gch"
443-
COMMAND ${PNACLPYTHON_PREFIX2} ${CMAKE_CXX_COMPILER} ${CUSTOM_CXX_COMPILER_SUBCOMMAND}
441+
COMMAND ${PNACLPYTHON_PREFIX2} ${CMAKE_CXX_COMPILER} ${DAEMON_CXX_COMPILER_SUBCOMMAND}
444442
${Defs} ${Flags} -x c++-header ${Header} -o "${OBJ_DIR}/${Target}.h.gch"
445443
DEPENDS ${Header}
446444
IMPLICIT_DEPENDS CXX ${Header}
@@ -450,7 +448,7 @@ function(ADD_PRECOMPILED_HEADER Target)
450448
add_dependencies(${Target} ${Target}-pch)
451449

452450
# PNaCl clang doesn't support -include-pch properly
453-
if (DAEMON_COMPILER_IS_CLANGCXX AND NOT NACL)
451+
if (NOT DAEMON_CXX_COMPILER_NAME STREQUAL "PNaCl")
454452
set_property(TARGET ${Target} APPEND PROPERTY COMPILE_OPTIONS "-include-pch;${OBJ_DIR}/${Target}.h.gch")
455453
else()
456454
set_property(TARGET ${Target} APPEND PROPERTY COMPILE_OPTIONS "-include;${OBJ_DIR}/${Target}.h;-Winvalid-pch")

cmake/CustomCompiler.cmake

Lines changed: 0 additions & 204 deletions
This file was deleted.

cmake/DaemonCompiler.cmake

Lines changed: 0 additions & 95 deletions
This file was deleted.

cmake/DaemonFlags.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ else()
199199

200200
if (ARCH STREQUAL "amd64")
201201
# K8 or EM64T minimum: AMD Athlon 64 ClawHammer, Intel Xeon Nocona, Intel Pentium 4 model F (Prescott revision EO), VIA Nano.
202-
if ("${DAEMON_CXX_COMPILER_ID}" STREQUAL "Intel")
202+
if ("${DAEMON_CXX_COMPILER_NAME}" STREQUAL "ICC")
203203
set(GCC_GENERIC_ARCH "pentium4")
204-
elseif ("${DAEMON_CXX_COMPILER_ID}" STREQUAL "Zig")
204+
elseif ("${DAEMON_CXX_COMPILER_NAME}" STREQUAL "Zig")
205205
set(GCC_GENERIC_ARCH "x86_64")
206206
else()
207207
set(GCC_GENERIC_ARCH "x86-64")
@@ -227,7 +227,7 @@ else()
227227
option(USE_CPU_GENERIC_ARCHITECTURE "Enforce generic -march and -mtune compiler options" ON)
228228
if (USE_CPU_GENERIC_ARCHITECTURE)
229229
set_c_cxx_flag("-march=${GCC_GENERIC_ARCH}")
230-
if ("${DAEMON_CXX_COMPILER_ID}" STREQUAL "Zig")
230+
if ("${DAEMON_CXX_COMPILER_NAME}" STREQUAL "Zig")
231231
set_c_cxx_flag("-mtune=${GCC_GENERIC_ARCH}")
232232
else()
233233
set_c_cxx_flag("-mtune=generic")

cmake/DaemonGame.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626

2727
include_directories(${MOUNT_DIR} ${LIB_DIR} ${LIB_DIR}/zlib)
28-
include(DaemonPlatform)
29-
include(DaemonNacl)
3028

3129
# Do not report unused native compiler if native vms are not built.
3230
# If only NACL vms are built, this will be reported in chainloaded build.
3331
if (BUILD_GAME_NATIVE_DLL OR BUILD_GAME_NATIVE_EXE OR NACL)
34-
include(DaemonCompiler)
32+
include(DaemonPlatform)
33+
include(DaemonNacl)
3534
include(DaemonFlags)
3635
endif()
3736

cmake/DaemonPlatform.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ else()
3939
endif()
4040

4141
include("${DAEMON_DIR}/tools/DaemonArchitecture/DaemonArchitecture.cmake")
42+
include("${DAEMON_DIR}/tools/DaemonCompiler/DaemonCompiler.cmake")
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /usr/bin/env bash
2+
3+
# test script
4+
5+
"${1}" DaemonCompiler.cpp -o /dev/null 2>&1 \
6+
| grep '###REPORT###' \
7+
| sed -e 's/.*(###REPORT###(//;s/)###REPORT###(/=/;s/)###REPORT###).*//'

0 commit comments

Comments
 (0)