Skip to content

Commit f960630

Browse files
committed
Fixing Windows Debug build
1. Fixing Windows debug build 2. Disabling Linux 32-bit release build
1 parent 2af0193 commit f960630

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

.appveyor.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,18 @@ environment:
1919
matrix:
2020
- GENERATOR: Visual Studio 12
2121
CONFIG: Debug
22-
DEBUG_FLAG: ON
2322
MSVC_PLATFORM: x86
2423

2524
- GENERATOR: Visual Studio 12
2625
CONFIG: RelWithDebInfo
27-
DEBUG_FLAG: OFF
2826
MSVC_PLATFORM: x86
2927

3028
- GENERATOR: Visual Studio 12 Win64
3129
CONFIG: Debug
32-
DEBUG_FLAG: ON
3330
MSVC_PLATFORM: x86_amd64
3431

3532
- GENERATOR: Visual Studio 12 Win64
3633
CONFIG: RelWithDebInfo
37-
DEBUG_FLAG: OFF
3834
MSVC_PLATFORM: x86_amd64
3935

4036
before_build:
@@ -46,7 +42,7 @@ before_build:
4642

4743
build_script:
4844
#parallel: true
49-
- cmake "-G%GENERATOR%" -DDEBUG=%DEBUG_FLAG% -DBUILD_TOOL_TESTS=ON ..\drltrace_src\
45+
- cmake "-G%GENERATOR%" -DCMAKE_BUILD_TYPE=%CONFIG% -DBUILD_TOOL_TESTS=ON ..\drltrace_src\
5046
- cmake --build . --config "%CONFIG%"
5147

5248
test_script:

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ env:
1515
- BUILD=x86_64-linux-gnu_debug
1616
CXXFLAGS=-m64 CFLAGS=-m64 LDFLAGS=-m64
1717
DEBUG_MODE=ON
18-
- BUILD=i686-linux-gnu_release
19-
CXXFLAGS=-m32 CFLAGS=-m32
20-
DEBUG_MODE=OFF
18+
#- BUILD=i686-linux-gnu_release
19+
# CXXFLAGS=-m32 CFLAGS=-m32
20+
# DEBUG_MODE=OFF
2121
- BUILD=i686-linux-gnu_debug
2222
CXXFLAGS=-m32 CFLAGS=-m32
2323
DEBUG_MODE=ON

drltrace_src/CMakeLists.txt

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232

3333
cmake_minimum_required(VERSION 3.2)
3434

35-
if (DEBUG)
36-
message(STATUS "Building Debug build")
37-
else()
38-
message(STATUS "Building RelWithDebInfo build")
39-
endif(DEBUG)
40-
4135
function (append_property_string type target name value)
4236
# XXX: if we require cmake 2.8.6 we can simply use APPEND_STRING
4337
get_property(cur ${type} ${target} PROPERTY ${name})
@@ -88,6 +82,8 @@ else ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
8882
set(location_suffix "")
8983
endif ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
9084

85+
message("Generated with config types: ${CMAKE_CONFIGURATION_TYPES}")
86+
9187
project(drltrace)
9288

9389
if ("${CMAKE_VERSION}" VERSION_EQUAL "3.0" OR
@@ -252,7 +248,7 @@ if (WIN32)
252248
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CL_CFLAGS}")
253249
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
254250
if (DEBUG)
255-
#set(OPT_CFLAGS "/DFEBUG")
251+
#set(OPT_CFLAGS "/DEBUG")
256252
add_definitions(-DDEBUG)
257253
endif (DEBUG)
258254
endif (WIN32)
@@ -262,6 +258,11 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPT_CFLAGS}")
262258
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPT_CFLAGS}")
263259
#endif ()
264260

261+
if (UNIX)
262+
set(EXTRA_CXXFLAGS "-std=c++11")
263+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}")
264+
endif()
265+
265266
#include(${PROJECT_SOURCE_DIR}/make/policies.cmake NO_POLICY_SCOPE)
266267

267268
##################################################
@@ -274,6 +275,21 @@ set(front_srcs
274275
# set(front_srcs ${front_srcs} ${PROJECT_SOURCE_DIR}/make/resources.rc)
275276
#endif ()
276277

278+
macro(fix_win32_flags srcfile)
279+
if (WIN32)
280+
if (DEBUG)
281+
get_property(cur SOURCE ${srcfile} PROPERTY COMPILE_FLAGS)
282+
string(REPLACE "/MTd " "" cur "${cur}") # Avoid override warning.
283+
set_source_files_properties(${srcfile} PROPERTIES COMPILE_FLAGS "${cur} /EHsc /MTd")
284+
append_property_string(SOURCE ${srcfile} LINK_FLAGS "/nodefaultlib:libcmt")
285+
else ()
286+
append_property_string(SOURCE ${srcfile} COMPILE_FLAGS "/EHsc /MT")
287+
endif ()
288+
endif ()
289+
endmacro ()
290+
291+
fix_win32_flags(drltrace_frontend.cpp)
292+
277293
add_executable(drltrace ${front_srcs})
278294

279295
#set_library_version(drltrace ${DRMF_VERSION})
@@ -425,7 +441,6 @@ else()
425441
set(drltrace_path "${drltrace_path}/drltrace")
426442
set(app_path "${app_path}/drltrace_app")
427443
endif(WIN32)
428-
message(${drltrace_path}, ${app_path})
429444

430445
prefix_cmd_if_necessary(drltrace_path OFF ${drltrace_path})
431446

0 commit comments

Comments
 (0)