More Windows work.

This commit is contained in:
Pietro Gagliardi 2016-06-01 22:18:40 -04:00
parent ee373a94d6
commit 1dbbab50a5
2 changed files with 15 additions and 20 deletions

View File

@ -96,7 +96,17 @@ else()
endif() endif()
if(MSVC) if(MSVC)
# TODO append2(CMAKE_C_FLAGS CMAKE_CXX_FLAGS
"-W4 -wd4100 -bigobj -RTC1 -RTCs -RTCu")
# shut the compiler up in some cases
# LONGTERM still needed?
append(CMAKE_CXX_FLAGS " -EHsc")
append2(CMAKE_SHARED_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS
" -largeaddressaware -incremental:no")
append(CMAKE_EXE_LINKER_FLAGS
" -largeaddressaware -incremental:no")
else() else()
append2(CMAKE_C_FLAGS CMAKE_CXX_FLAGS append2(CMAKE_C_FLAGS CMAKE_CXX_FLAGS
" -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-switch") " -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-switch")
@ -127,6 +137,10 @@ else()
# don't amend CMAKE_STATIC_LINKER_FLAGS; that's for ar # don't amend CMAKE_STATIC_LINKER_FLAGS; that's for ar
endif() endif()
if(NOT _SHARED)
append(_LIBUI_CFLAGS " -D_UI_STATIC")
endif()
add_subdirectory("common") add_subdirectory("common")
add_subdirectory("${_OSDIR}") add_subdirectory("${_OSDIR}")
if(_SHARED) if(_SHARED)
@ -164,8 +178,4 @@ set_target_properties(tester PROPERTIES
OUTPUT_NAME test OUTPUT_NAME test
WIN32_EXECUTABLE FALSE) WIN32_EXECUTABLE FALSE)
# the same resources.rc is shared by all the examples
if(_RESOURCES_RC)
set(_RESOURCES_RC "../${_RESOURCES_RC}")
endif()
add_subdirectory("examples") add_subdirectory("examples")

View File

@ -27,22 +27,7 @@
# TODO /analyze requires us to write annotations everywhere # TODO /analyze requires us to write annotations everywhere
# TODO undecided flags from qo? # TODO undecided flags from qo?
# -RTCc is not supplied because it's discouraged as of VS2015; see https://www.reddit.com/r/cpp/comments/46mhne/rtcc_rejects_conformant_code_with_visual_c_2015/d06auq5 # -RTCc is not supplied because it's discouraged as of VS2015; see https://www.reddit.com/r/cpp/comments/46mhne/rtcc_rejects_conformant_code_with_visual_c_2015/d06auq5
CFLAGS += \
-W4 \
-wd4100 \
-TC \
-bigobj -nologo \
-RTC1 -RTCs -RTCu
# TODO prune these
# -EHsc is to shut the compiler up in some cases
CXXFLAGS += \
-W4 \
-wd4100 \
-TP \
-bigobj -nologo \
-RTC1 -RTCs -RTCu \
-EHsc
# TODO warnings on undefined symbols # TODO warnings on undefined symbols
LDFLAGS += \ LDFLAGS += \