From: hobbes1069 Date: Tue, 30 Jun 2015 18:01:19 +0000 (+0000) Subject: Fix how build flags are reported. X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=f218f39f2f49d0fa7d4c6cf3ebe90e4f446071e5;p=freetel-svn-tracking.git Fix how build flags are reported. git-svn-id: https://svn.code.sf.net/p/freetel/code@2229 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/CMakeLists.txt b/codec2-dev/CMakeLists.txt index 3e6df371..e2b270ae 100644 --- a/codec2-dev/CMakeLists.txt +++ b/codec2-dev/CMakeLists.txt @@ -54,6 +54,10 @@ endif() # Set default C++ flags. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -O2") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS}") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS}") # -fPIC is implied on MinGW... if(NOT WIN32) @@ -61,9 +65,12 @@ if(NOT WIN32) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") endif() - message(STATUS "Build type is: " ${CMAKE_BUILD_TYPE}) -message(STATUS "Compiler Flags: " ${CMAKE_CXX_FLAGS}) +string(TOUPPER ${CMAKE_BUILD_TYPE} _FLAGS) +if(NOT "_FLAGS" STREQUAL "NONE") + set(BUILD_FLAGS "${CMAKE_C_FLAGS_${_FLAGS}}") +endif() +message(STATUS "Compiler Flags: " ${BUILD_FLAGS}) # # Setup Windows/MinGW specifics here. diff --git a/codec2-dev/src/CMakeLists.txt b/codec2-dev/src/CMakeLists.txt index d0df3f54..206f9ee2 100644 --- a/codec2-dev/src/CMakeLists.txt +++ b/codec2-dev/src/CMakeLists.txt @@ -91,9 +91,9 @@ set(CODEBOOKSGE ${D}/gecb.txt) # when crosscompiling import the executable targets from a file if(CMAKE_CROSSCOMPILING) - #set(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Point to the export file from a native build") - #include(${IMPORT_EXECUTABLES}) - add_executable(generate_codebook IMPORTED) + set(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Point to the export file from a native build") + include(${IMPORT_EXECUTABLES}) + #add_executable(generate_codebook IMPORTED) set_property(TARGET generate_codebook PROPERTY IMPORTED_LOCATION ${GENERATE_CODEBOOK}) else(CMAKE_CROSSCOMPILING) # Build code generator binaries. These do not get installed.