BYVoid / uchardet

An encoding detector library ported from Mozilla
Other
609 stars 107 forks source link

Some QoL changes #24

Closed wiiaboo closed 8 years ago

Jehan commented 8 years ago

Thanks. I tested and spotted 1 bug. When trying to build only the static library (BUILD_SHARED_LIBS is OFF), cmake returns this error:

CMake Error at src/CMakeLists.txt:101 (install): install TARGETS given no ARCHIVE DESTINATION for static library target "libuchardet".

Also the CMAKE_INSTALL_BINDIR option is cool, but it is not visible for instance in a call to ccmake. This makes the option pretty invisible (even though we would write it in the INSTALL file, I prefer when an option is also discoverable in the building script itself). Can you make so that this option is visible in a call to ccmake?

Other than these, that looks like very cool additions that I will happily add. :-)

wiiaboo commented 8 years ago

I think this fixes both issues.

I had no idea there was something like ccmake. They don't include that in mingw builds. I tested instead with cmake -L and it showed just user-facing options, I guess, and it included CMAKE_INSTALL_BINDIR.

Jehan commented 8 years ago

Tested. Looks good and merged. Thanks for the patches!

Jehan commented 8 years ago

Hi. Could you have a look at proposed commit 8906244. I'm afraid this contributor is right and I will have to revert your commit. Could you tell me what exactly was the problem with Ninja (commit f53cb8c)? Maybe you could propose another fix for your problem which does not break other builds.

wiiaboo commented 8 years ago

The error is with Ninja in Windows, at least. With make it works fine.

FAILED: cmd.exe /C "cd . && C:\builds\ab\msys64\mingw64\bin\c++.exe   -IC:/builds/ab/local64/include -mthreads -mtune=generic -O2 -pipe  -LC:/builds/ab/local64/lib -pipe -static-libgcc -static-libstdc++  -Wl,--version-script,'C:/builds/ab/build/uchardet-git/build-64bit/src/version.script' -shared -o src\libuchardet.dll -Wl,--out-implib,src\libuchardet.dll.a -Wl,--major-image-version,0,--minor-image-version,0 src/CMakeFiles/libuchardet.dir/CharDistribution.cpp.obj src/CMakeFiles/libuchardet.dir/JpCntx.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangArabicModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangBulgarianModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangRussianModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangEsperantoModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangFrenchModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangDanishModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangGermanModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangGreekModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangHungarianModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangHebrewModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangSpanishModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangThaiModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangTurkishModel.cpp.obj src/CMakeFiles/libuchardet.dir/LangModels/LangVietnameseModel.cpp.obj src/CMakeFiles/libuchardet.dir/nsHebrewProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsCharSetProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsBig5Prober.cpp.obj src/CMakeFiles/libuchardet.dir/nsEUCJPProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsEUCKRProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsEUCTWProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsEscCharsetProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsEscSM.cpp.obj src/CMakeFiles/libuchardet.dir/nsGB2312Prober.cpp.obj src/CMakeFiles/libuchardet.dir/nsMBCSGroupProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsMBCSSM.cpp.obj src/CMakeFiles/libuchardet.dir/nsSBCSGroupProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsSBCharSetProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsSJISProber.cpp.obj src/CMakeFiles/libuchardet.dir/nsUTF8Prober.cpp.obj src/CMakeFiles/libuchardet.dir/nsLatin1Prober.cpp.obj src/CMakeFiles/libuchardet.dir/nsUniversalDetector.cpp.obj src/CMakeFiles/libuchardet.dir/uchardet.cpp.obj  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/builds/ab/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open linker script file 'C:/builds/ab/build/uchardet-git/build-64bit/src/version.script': Invalid argument
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
wiiaboo commented 8 years ago

Using escaped double quotes instead of single quotes seems to fix it too.