Add Debug profile to CMake
Change-Id: Ie544d6f37a62f0a9b226c71ba76d13a18bf5d228
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 205319b..0fe2403 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,12 @@
cmake_minimum_required(VERSION 3.9)
project(dereko2vec VERSION 0.9.0 DESCRIPTION "Fork from wang2vec with extensions for re-training and count based models")
set(CMAKE_VERBOSE_MAKEFILE on)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lm -pthread -O3 -march=native -mtune=native -Wall -funroll-loops")
-set(ADDITIONAL_LIBS pthread rt snappy z bz2 lz4 zstd stdc++ dl)
+if (CMAKE_BUILD_TYPE MATCHES Debug)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lm -g -O0 -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-but-set-parameter -Wno-unused-value -Wno-unused-result")
+else ()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -lm -pthread -O3 -march=native -mtune=native -Wall -funroll-loops")
+endif ()
+set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} pthread rt snappy z bz2 lz4 zstd stdc++ dl)
include(GNUInstallDirs)
include_directories(/usr/local/include;/usr/local/kl/include)
diff --git a/src/dereko2vec.c b/src/dereko2vec.c
index ccedb96..8c34179 100644
--- a/src/dereko2vec.c
+++ b/src/dereko2vec.c
@@ -508,7 +508,7 @@
}
}
-void SaveArgs(int argc, char **argv) {
+void SaveArgs(unsigned int argc, char **argv) {
unsigned int i;
char args_file[MAX_STRING];
strcpy(args_file, output_file);